Yury Selivanov added the comment:

> Why would we mangle the names of arguments in the first place?  What possible 
> use case is there?

The use case is multiple inheritance. You can define your methods with keyword 
and keyword-only params starting with '__', put in them some cached default for 
speeding up lookup time, and not being worried that someone can override the 
arg. The second reason is, I believe, is desire to be consistent with mangling 
methods and attributes.

Again, using mangling for function arguments is, probably, not the best 
practice, and that, combined with the fact, that people are just starting to 
play with annotations, explains why this bug was so long unnoticed.

But the semantics of arg names mangling is already there, implemented 
everywhere but __annotations__.

The attached patch is fairly simple, and really is just a bug fix. It would be 
great if we can get this in 3.4 (and even in 3.3 and 3.2).

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue20625>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to