Can you use self in __str__

Chris Angelico rosuav at gmail.com
Fri Nov 28 00:00:43 EST 2014


On Fri, Nov 28, 2014 at 2:04 PM, Shiyao Ma <i at introo.me> wrote:
> What if it's in the local namespace of a function or method? IDK, try
> to get that thing first.

What if it's in multiple namespaces? What if it's not in any at all?
Your solution is not going to work in the general case, AND it's a bad
idea. Please don't do this in any code that I'll ever have to
maintain.

ChrisA



More information about the Python-list mailing list