*Greetings Fellow Earthlings,*
*In python 3.11, python has a number of built-in functions which act as an
Interface for magic dunder methods. Two examples of what I am talking about
are shown below: *
*Begin Example 1 of 2*
*rocky = object()x = getattr(rocky, "length") x = rocky.__getattr__("length") *
*Begin Example 2 of 2*
*box = [1, 2, 3]it = iter(box) it = box.__iter__()*
*My suggestion is that in future versions of python, we will have `mro()`
behave in a similar fashion. *
*obj = object()x = mro(obj) x = obj.__mro__() *
*Additionally, the class named `object` should have a method named
`__mro__` and any class which inherits from `object` may override
`__mro__` or inherit the default `* *object* *.__mro__` . *
*Samuel Muldoon*
*(720) 653 -2408*
*[email protected] <[email protected]>*
_______________________________________________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
https://mail.python.org/archives/list/[email protected]/message/IAGPFNRN5BQ2MFIIBCW5PSKQKDB7LWKB/
Code of Conduct: http://python.org/psf/codeofconduct/