[Python-ideas] Change Behind The Scenes Attribute Access from Class to Object
Adam Carruthers
adam.j.carruthers at hotmail.co.uk
Sat Dec 27 21:15:43 CET 2014
At the moment, when a python function, like print, calls an object attribute it does this (if it were written in python): type(obj).__str__(obj)This can be restrictive in lots of situations and I think it would be better to just get the attribute from the object itself. obj.__str__()It would make you free to override it on a per object basis. In some cases, this could lead to huge optimization.Obviously, it is easy to fix yourself, but it is a layer of uncharacteristic unintuitiveness: def __str__(self): self._str()
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20141227/ca5379a3/attachment.html>
More information about the Python-ideas
mailing list