> Would it be too much trouble to prevent replacing > double-underscore attributes like __name__ and __file__? This can be handy sometimes. > I'll accept a "consenting adults" argument -- it's just > that somehow this makes me uneasy: OK - accept it :-) Just dont do it if it makes you uneasy. > >>> import foo > >>> foo.__name__ > 'bar' > >>> foo.__file__ > 'bar.py' > >>> foo > <module 'bar' from 'bar.py'> That is no worse than, say: >>> a=1 >>> globals()['a']=2 >>> a 2 So you could make the same argument that globals() should be read-only, to force you to do the "normal" thing. To me, this is one of Python's big features. I dont want it holding my hand so tightly it cuts circulation :-) Mark.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4