Order in metaclass

Peter Otten __peter__ at web.de
Wed Oct 13 12:18:02 EDT 2004


Carlos Ribeiro wrote:

> executed (which count() can guarantee). There are two situations where
> the simpler counter works, but the getframe hack doesn't:
> 
> -- if I have a loop inside my class that is used to declare bunch of
> attributes, all of them will have the same line number... but a
> different sequence number if the simpler method is chosen.
> 
> -- if a function is called that returns a bunch of attributes (not
> common practice, but still possible). All attributes are at the same
> line in this case. Example:
> 
> class Foo:
> a,b,c = myfunc(...)

Do you have an example handy? I had so far no success breaking Bengt's code.

Peter 
 




More information about the Python-list mailing list