Re: [Python-Dev] Regarding stdlib socket module, _fileobject.flush() method using ._rbufsize instead of ._wbufsize

2013-10-16 Thread Terry Reedy
On 10/16/2013 5:01 PM, Peter Portante wrote: Hello, Is there a reason why the stdlib socket module _fileobject.flush() method is using ._rbufsize instead of ._wbufsize at line 297 (Python 2.7.3), where it determines the buffer_size value to be used for _sock.sendall()? Does anybody know the his

Re: [Python-Dev] cpython: Rename contextlib.ignored() to contextlib.ignore().

2013-10-16 Thread Nick Coghlan
On 16 Oct 2013 21:34, "Victor Stinner" wrote: > > 2013/10/16 Raymond Hettinger : > > FWIW, here's a little history: > > Thank you! It helped me to understand the story. > > > * In February, I presented ignore() in the keynote for the U.S. Pycon. > > Again, the feedback was positive. > > I missed

[Python-Dev] Regarding stdlib socket module, _fileobject.flush() method using ._rbufsize instead of ._wbufsize

2013-10-16 Thread Peter Portante
Hello, Is there a reason why the stdlib socket module _fileobject.flush() method is using ._rbufsize instead of ._wbufsize at line 297 (Python 2.7.3), where it determines the buffer_size value to be used for _sock.sendall()? Does anybody know the history behind this? Based on what I read in the

Re: [Python-Dev] cpython: Rename contextlib.ignored() to contextlib.ignore().

2013-10-16 Thread Eric Snow
On Wed, Oct 16, 2013 at 9:24 AM, Barry Warsaw wrote: > On Oct 16, 2013, at 08:31 AM, Eric Snow wrote: >>When a module's maintainer makes a decision on a relatively insignificant >>addition to the module, I'd expect little resistance or even comment (the >>original commit was months ago). That's w

Re: [Python-Dev] Making submodules available when importing top one

2013-10-16 Thread Eric Snow
On Wed, Oct 16, 2013 at 10:26 AM, Facundo Batista wrote: > (all this using Python 3.4.0a3+) > > In the stdlib, I see that (as an example): > import os os.path.abspath > os.path > > > > However, for other (newer) modules: > import urllib urllib.requests.urlopen > Tracebac

Re: [Python-Dev] Making submodules available when importing top one

2013-10-16 Thread Guido van Rossum
On Wed, Oct 16, 2013 at 9:26 AM, Facundo Batista wrote: > (all this using Python 3.4.0a3+) > > In the stdlib, I see that (as an example): > > >>> import os > >>> os.path.abspath > > >>> os.path > > > > However, for other (newer) modules: > > >>> import urllib > >>> urllib.requests.urlopen > Trac

Re: [Python-Dev] Making submodules available when importing top one

2013-10-16 Thread Oleg Broytman
On Wed, Oct 16, 2013 at 01:26:11PM -0300, Facundo Batista wrote: > (all this using Python 3.4.0a3+) > > In the stdlib, I see that (as an example): > > >>> import os > >>> os.path.abspath > > >>> os.path > > > > However, for other (newer) modules: > > >>> import urllib > >>> urllib.requests

[Python-Dev] Making submodules available when importing top one

2013-10-16 Thread Facundo Batista
(all this using Python 3.4.0a3+) In the stdlib, I see that (as an example): >>> import os >>> os.path.abspath >>> os.path However, for other (newer) modules: >>> import urllib >>> urllib.requests.urlopen Traceback (most recent call last): File "", line 1, in AttributeError: 'module' objec

Re: [Python-Dev] cpython: Rename contextlib.ignored() to contextlib.ignore().

2013-10-16 Thread Stephen J. Turnbull
Eric Snow writes: > That's why I'm surprised by the reaction to this change.  It just > seems like the whole thing is being blown way out of proportion to > the detriment of other interesting problems. The feature itself a perfect bikeshedding pitfall. Everybody here understands the Zen, and

Re: [Python-Dev] cpython: Rename contextlib.ignored() to contextlib.ignore().

2013-10-16 Thread Antoine Pitrou
Le Wed, 16 Oct 2013 08:31:44 -0600, Eric Snow a écrit : > > You make several good points, Victor. However, in this case the > change is a new function and a small, innocuous one at that. That is > not enough justification alone, as Antoine pointed out, but the > module's maintainer made a decis

Re: [Python-Dev] cpython: Rename contextlib.ignored() to contextlib.ignore().

2013-10-16 Thread Ethan Furman
On 10/16/2013 07:06 AM, Ethan Furman wrote: Actually, it was to kick around one line of code, the most import one: def ignored(...): s/import/important/ ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/

Re: [Python-Dev] cpython: Rename contextlib.ignored() to contextlib.ignore().

2013-10-16 Thread Stephen J. Turnbull
Victor Stinner writes: > the idea), but I don't understand the purpose of adding a new syntax > doing exactly the same than try/except: > > > with trap(OSError) as cm: > > os.unlink('missing.txt') > > if cm.exc: > > do_something() > > Nobody noticed that this can

Re: [Python-Dev] cpython: Rename contextlib.ignored() to contextlib.ignore().

2013-10-16 Thread Barry Warsaw
On Oct 16, 2013, at 08:31 AM, Eric Snow wrote: >When a module's maintainer makes a decision on a relatively insignificant >addition to the module, I'd expect little resistance or even comment (the >original commit was months ago). That's why I'm surprised by the reaction >to this change. It just

Re: [Python-Dev] cpython: Rename contextlib.ignored() to contextlib.ignore().

2013-10-16 Thread Victor Stinner
I would rewrite your examples using try/finally: try: try: os.unlink('missing.txt') finally: some other code except OSError as exc: do_something() It's differently than yours, because it catchs OSError on "some; other

Re: [Python-Dev] cpython: Rename contextlib.ignored() to contextlib.ignore().

2013-10-16 Thread R. David Murray
Victor Stinner a écrit : > I might agree with idea of contextlib.ignore() (I'm still opposed to > the idea), but I don't understand the purpose of adding a new syntax > doing exactly the same than try/except: > > > with trap(OSError) as cm: > > os.unlink('missing.txt') > > if cm.

Re: [Python-Dev] cpython: Rename contextlib.ignored() to contextlib.ignore().

2013-10-16 Thread Ethan Furman
On 10/16/2013 12:07 AM, Raymond Hettinger wrote: On Oct 15, 2013, at 4:24 PM, Nick Coghlan wrote: this thread still epitomises everything that sucks about soul destroying, energy draining bikeshed painting that makes me wonder why I ever bother trying to make anything better. I think each of

Re: [Python-Dev] cpython: Rename contextlib.ignored() to contextlib.ignore().

2013-10-16 Thread Eric Snow
On Oct 16, 2013 5:35 AM, "Victor Stinner" wrote: > > 2013/10/16 Raymond Hettinger : > > FWIW, here's a little history: > > Thank you! It helped me to understand the story. > > > * In February, I presented ignore() in the keynote for the U.S. Pycon. > > Again, the feedback was positive. > > I mis

Re: [Python-Dev] cpython: Rename contextlib.ignored() to contextlib.ignore().

2013-10-16 Thread Antoine Pitrou
Le Wed, 16 Oct 2013 14:09:16 +0200, Antoine Pitrou a écrit : > Le Wed, 16 Oct 2013 14:01:37 +0200, > Victor Stinner a écrit : > > 2013/10/16 Antoine Pitrou : > > >> By the way, what are the performances of contextlib.ignore()? > > >> Exceptions can be slow in some cases. Adding something even > >

Re: [Python-Dev] cpython: Rename contextlib.ignored() to contextlib.ignore().

2013-10-16 Thread Antoine Pitrou
Le Wed, 16 Oct 2013 14:01:37 +0200, Victor Stinner a écrit : > 2013/10/16 Antoine Pitrou : > >> By the way, what are the performances of contextlib.ignore()? > >> Exceptions can be slow in some cases. Adding something even slower > >> would not be a good idea. > > > > A "try" block which succeeds

Re: [Python-Dev] cpython: Rename contextlib.ignored() to contextlib.ignore().

2013-10-16 Thread Victor Stinner
2013/10/16 Antoine Pitrou : >> By the way, what are the performances of contextlib.ignore()? >> Exceptions can be slow in some cases. Adding something even slower >> would not be a good idea. > > A "try" block which succeeds is fast. Ah yes, I never reminder this fact. I try to not care too much o

Re: [Python-Dev] cpython: Rename contextlib.ignored() to contextlib.ignore().

2013-10-16 Thread Antoine Pitrou
Le Wed, 16 Oct 2013 13:42:34 +0200, Victor Stinner a écrit : > I might agree with idea of contextlib.ignore() (I'm still opposed to > the idea), but I don't understand the purpose of adding a new syntax > doing exactly the same than try/except: > > > with trap(OSError) as cm: > > os.u

Re: [Python-Dev] cpython: Rename contextlib.ignored() to contextlib.ignore().

2013-10-16 Thread Victor Stinner
I might agree with idea of contextlib.ignore() (I'm still opposed to the idea), but I don't understand the purpose of adding a new syntax doing exactly the same than try/except: > with trap(OSError) as cm: > os.unlink('missing.txt') > if cm.exc: > do_something() Nobody not

Re: [Python-Dev] cpython: Rename contextlib.ignored() to contextlib.ignore().

2013-10-16 Thread Victor Stinner
2013/10/16 Raymond Hettinger : > FWIW, here's a little history: Thank you! It helped me to understand the story. > * In February, I presented ignore() in the keynote for the U.S. Pycon. > Again, the feedback was positive. I missed this edition of Pycon US. How did you feedback on the keynote?

Re: [Python-Dev] cpython: Rename contextlib.ignored() to contextlib.ignore().

2013-10-16 Thread Victor Stinner
CONGRATULATION! This thread reached 100 mails, it's now time to summarize it into a PEP. Is there a candidate to write it? If no PEP is written, the thread will never die and people will continue to feed it. Victor 2013/10/11 Antoine Pitrou : > > Hello, > > On Fri, 11 Oct 2013 07:39:48 +0200 (CE

Re: [Python-Dev] cpython: Rename contextlib.ignored() to contextlib.ignore().

2013-10-16 Thread Antoine Pitrou
Le Wed, 16 Oct 2013 00:07:16 -0700, Raymond Hettinger a écrit : > > As Nick said, this thread was just awful. I found it painful to read > each day. Shoot from the hip comments were given greater weight than > months of development. Neither Nick nor I were given an ounce of > respect for the th

Re: [Python-Dev] cpython: Rename contextlib.ignored() to contextlib.ignore().

2013-10-16 Thread Raymond Hettinger
On Oct 15, 2013, at 4:24 PM, Nick Coghlan wrote: > this thread still epitomises everything that sucks about soul destroying, > energy draining bikeshed painting that makes me wonder why I ever bother > trying to make anything better. > FWIW, here's a little history: * Last year, one of my