New submission from Peter Schuller peter.schul...@infidyne.com:
The documentation states it returns a file-like object. In Python 2.5+ I
expect such file-like objects to have a context manager for use with the with
statement.
In my particular use-case, the lack comes from urllib.addinfourl
of it (such as
the other poster's inspect example).
--
/ Peter Schuller
PGP userID: 0xE9758B7D or 'Peter Schuller [EMAIL PROTECTED]'
Key retrieval: Send an E-Mail to [EMAIL PROTECTED]
E-Mail: [EMAIL PROTECTED] Web: http://www.scode.org
--
http://mail.python.org/mailman/listinfo/python-list
Well, all I will say is that many people on this list, myself
included, do know Python internals, and we use the method we've been
suggesting here, without problems.
Ok. That is useful to know (that it is being done in practice without
problems).
Thanks!
--
/ Peter Schuller
PGP userID
won't end up doing that, but it
may come to be useful in the future.
--
/ Peter Schuller
PGP userID: 0xE9758B7D or 'Peter Schuller [EMAIL PROTECTED]'
Key retrieval: Send an E-Mail to [EMAIL PROTECTED]
E-Mail: [EMAIL PROTECTED] Web: http://www.scode.org
--
http://mail.python.org/mailman/listinfo
side-effects? One
example would be sys.modules that I mentioned in the previous
post. Another, possibly related, might be interaction with the import
keyword and its implementation.
I will probably have to read up more on the semantics of __import__
and related machinery.
--
/ Peter Schuller
PGP
won't actually *BE* org.lib.animal.Monkey. Perhaps manipulating
__module__ is enough; perhaps not (for example, what about
sys.modules?). Looks like I'll just live with putting more than I
would like in the same file.
--
/ Peter Schuller
PGP userID: 0xE9758B7D or 'Peter Schuller [EMAIL PROTECTED
files and modules is non-existent.
--
/ Peter Schuller
PGP userID: 0xE9758B7D or 'Peter Schuller [EMAIL PROTECTED]'
Key retrieval: Send an E-Mail to [EMAIL PROTECTED]
E-Mail: [EMAIL PROTECTED] Web: http://www.scode.org
--
http://mail.python.org/mailman/listinfo/python-list
that it may not be realistic that every animal
implementation would be that long; in many cases a lot of code would
be in common. But feel free to substitude for something else (a Zoo
say).
--
/ Peter Schuller
PGP userID: 0xE9758B7D or 'Peter Schuller [EMAIL PROTECTED]'
Key retrieval: Send an E
introducing as many packages as you
introduce files.
--
/ Peter Schuller
PGP userID: 0xE9758B7D or 'Peter Schuller [EMAIL PROTECTED]'
Key retrieval: Send an E-Mail to [EMAIL PROTECTED]
E-Mail: [EMAIL PROTECTED] Web: http://www.scode.org
--
http://mail.python.org/mailman/listinfo/python-list