On Sat, Feb 11, 2017 at 2:25 AM, Steven D'Aprano <st...@pearwood.info> wrote:
> If I'm reading this right, you want this behaviour:
>
> class Spam:
>     pass
>
> def Spam.func(self): pass
>
> assert 'Spam.func' not in Spam.__dict__
> assert 'func' in Spam.__dict__
>
> assert Spam.func.__name__ == 'Spam.func'
> assert Spam.func.__qualname__ == 'Spam.Spam.func'
>
> If that's the case, I can only ask... what advantage do you see from
> this? Because I can see plenty of opportunity for confusion, and no
> advantage.
>
>

I might be wrong about the __name__; that was a response that came
from the massively extensive research of "hmm, I think this would be
what I'd do". It seems the simplest way to cope with the many
possibilities; having __name__ be "func" would work in the dot form,
but not others. But that's bikeshedding.

ChrisA
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to