We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
__
python's mangling system is convenient, but with this method of aliasing member, we do not mangle the alias names.
leading to issues like this:
class Foo: @aka.valiases("__mangled_alias") def __mangled_initial(self): return "val" print(Foo().__mangled_alias()) # prints "val"
I would expect the above to fail, and leave the alias's name as _Foo__mangled_alias instead, so that this succeeds:
_Foo__mangled_alias
class Foo: @aka.valiases("__mangled_alias") def __mangled_initial(self): return "val" print(Foo()._Foo__mangled_alias()) # prints "val"
if alias.__set_name__ gets a name that has leading __ (with at most 1 trailing _), then mangle the alias's name based on owner.__name__.
alias.__set_name__
name
_
owner.__name__
ex:
class Foo: prop = 1 prop_alias = alias(alias_name="__prop") prop_alias.attach(Foo) assert Foo()._Foo__prop == 1
We might want to add a parameter no_mangle or such that disables this behavior
no_mangle
The text was updated successfully, but these errors were encountered:
mxndtaylor
No branches or pull requests
Is your feature request related to a problem?
python's mangling system is convenient, but with this method of aliasing member, we do not mangle the alias names.
leading to issues like this:
I would expect the above to fail, and leave the alias's name as
_Foo__mangled_alias
instead, so that this succeeds:Describe the solution you'd like
if
alias.__set_name__
gets aname
that has leading__
(with at most 1 trailing_
), then mangle the alias's name based onowner.__name__
.ex:
Additional context
We might want to add a parameter
no_mangle
or such that disables this behaviorThe text was updated successfully, but these errors were encountered: