On Fri, Apr 03, 2020 at 12:28:36AM +0400, Abdur-Rahmaan Janhangeer wrote:
 
> This means we have a __repr__ option in packages (Without Steven's snippet
> above)?

There is no "hook" in the package file structure where you can customize 
the repr. It is built into the module type.

Once loaded, packages are just a module object like any other module. If 
you want to change the repr() of modules, you will need to change the 
built-in ModuleType class.

But I can tell you that this will 99.999999% be rejected. And if it is 
accepted, I can tell you that the first time you get hit by a massive 
wall of text from a package docstring in an exception or some other use 
of repr(), you will likely regret the change.


-- 
Steven
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/QZBY2XMQHPFXWX56RURGOZGXJBUSCGR2/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to