[Lldb-commits] [PATCH] D81516: [lldb/Test] Ensure inline tests have a unique build directory

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Jun 11 05:27:00 PDT 2020

labath accepted this revision.
labath added inline comments.
This revision is now accepted and ready to land.

Comment at: lldb/packages/Python/lldbsuite/test/lldbinline.py:209
     test_class = type(name, (InlineTest,), dict(test=test_func,
-        name=name, _build_dict=build_dict))
+        name=name, __inline_name__=name, _build_dict=build_dict))
JDevlieghere wrote:
> labath wrote:
> > `__inline_name__` is not a good name according to <https://www.python.org/dev/peps/pep-0008/>:
> > ```
> > __double_leading_and_trailing_underscore__: "magic" objects or attributes that live in user-controlled namespaces. E.g. __init__, __import__ or __file__. Never invent such names; only use them as documented.
> > ```
> > 
> I did it for consistency with `__no_debug_info_test__`. Based on that PEP we should rename it to `__no_debug_info_test`?
I think a single underscore should be enough. I am not sure the mangling magic invoked by a double underscore will  work for this case:
Note 2: Name mangling can make certain uses, such as debugging and __getattr__(), less convenient.
The PEP is very cautious about (not) encouraging double underscores, and a single leading underscore already says this is private.



More information about the lldb-commits mailing list