__name__ becoming read-write?

Hallvard B Furuseth h.b.furuseth at usit.uio.no
Mon Aug 23 10:50:22 EDT 2004


Arthur wrote:

> Did I hallucinate something about __name__ becoming read-write?

_Becoming_ read-write?  When was it read-only?

Python 1.5.2 (#1, Jul 14 2004, 20:34:28)  [GCC 3.2.3] on sunos5
Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
>>> class foo: pass
... 
>>> foo.__name__ = 'bar'
>>> foo.__module__ = 'baz' 
>>> foo
<class baz.bar at c5ee0>

-- 
Hallvard



More information about the Python-list mailing list