Josh Rosenberg <shadowranger+pyt...@gmail.com> added the comment:

I suspect these fixers were left out simply because no one expected anyone to 
call the dunder names directly; the whole point of the dunder names is that 
they're not used directly, being invoked by syntax/context (__nonzero__ being 
the first thing tried for implicit boolean testing or calls to 
bool/operator.truth) or by top-level functions (__oct__/__hex__ being called by 
oct/hex).

The only legitimate use case I can think of off-hand would be in class 
hierarchies, where a child dunder method is implemented in terms of a super() 
call to invoke the parent.

Do you have any examples of code bases that rely on this? I've never seen one 
personally, but I'm not about to claim exhaustive knowledge of all Python code 
in the world.

----------
nosy: +josh.r

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

Reply via email to