A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2000-June/004427.html below:

[Python-Dev] Protecting __name__ &c.

[Python-Dev] Protecting __name__ &c. [Python-Dev] Protecting __name__ &c.Ka-Ping Yee pingster@ilm.com
Fri, 2 Jun 2000 16:10:01 -0700 (PDT)
Would it be too much trouble to prevent replacing
double-underscore attributes like __name__ and __file__?

I'll accept a "consenting adults" argument -- it's just
that somehow this makes me uneasy:

    Python 1.5.2 (#54, Jul 14 1999, 12:50:51) [C] on irix6
    Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
    >>> import foo
    >>> foo.__name__
    'bar'
    >>> foo.__file__
    'bar.py'
    >>> foo
    <module 'bar' from 'bar.py'>

Of course, there is no 'bar.py'.  'foo.py' just contains

    __file__ = 'bar.py'
    __name__ = 'bar'

(If you say i deserved to be punished for such heresy, fine...)



-- ?!ng




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