[issue12487] urllib2.urlopen() returns object missing context manager

2011-07-04 Thread Peter Schuller
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

Re: Module/package hierarchy and its separation from file structure

2008-01-30 Thread Peter Schuller
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

Re: Module/package hierarchy and its separation from file structure

2008-01-30 Thread Peter Schuller
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

Re: Module/package hierarchy and its separation from file structure

2008-01-30 Thread Peter Schuller
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

Re: Module/package hierarchy and its separation from file structure

2008-01-29 Thread Peter Schuller
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

Re: Module/package hierarchy and its separation from file structure

2008-01-29 Thread Peter Schuller
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

Re: Module/package hierarchy and its separation from file structure

2008-01-24 Thread Peter Schuller
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

Module/package hierarchy and its separation from file structure

2008-01-23 Thread Peter Schuller
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

Re: Module/package hierarchy and its separation from file structure

2008-01-23 Thread Peter Schuller
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