[issue19266] Rename contextlib.ignore to contextlib.suppress

2013-10-17 Thread Roundup Robot
Roundup Robot added the comment: New changeset 22247b7d17fa by Nick Coghlan in branch 'default': Close #19266: contextlib.ignore -> contextlib.suppress http://hg.python.org/cpython/rev/22247b7d17fa -- nosy: +python-dev resolution: -> fixed stage: needs patch -> committed/rejected status

[issue19266] Rename contextlib.ignore to contextlib.suppress

2013-10-16 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: -haypo ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pytho

[issue19266] Rename contextlib.ignore to contextlib.suppress

2013-10-16 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Feel free to ignore() me if it helps to close this debate. English is not my native language and my understanding may not match that of the majority of users. Note, however, that this debate might not even have started if not for a change s/ignored/ign

[issue19266] Rename contextlib.ignore to contextlib.suppress

2013-10-16 Thread Nick Coghlan
Nick Coghlan added the comment: Agreed it's a close call - it's really the docs consistency issue that tipped the balance for me, since I think either ignore *or* suppress would be a suitable name for the pattern when used correctly. -- ___ Python tra

[issue19266] Rename contextlib.ignore to contextlib.suppress

2013-10-16 Thread Nick Coghlan
Nick Coghlan added the comment: The reason I specifically *don't* like trap or catch for this is that they both have "... and do something with it" connotations for me, whereas ignore and suppress both appropriately imply "... and silently discard it". -- ___

[issue19266] Rename contextlib.ignore to contextlib.suppress

2013-10-16 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: > Catch would be fine with me :) Both "catch" and "trap" have the same problem in my view: you don't get to eat what you have caught (or trapped). :-) > Please note that someone *reading the thread* on python-dev > misunderstood what ignore did after *

[issue19266] Rename contextlib.ignore to contextlib.suppress

2013-10-16 Thread Nick Coghlan
Nick Coghlan added the comment: I didn't choose suppress on a whim. I actually agree with Raymond that ignore reads better when the context manager is used correctly, but suppress is more consistent with the terminology used in the documentation (including even PEP 343), *and* I think it is sligh

[issue19266] Rename contextlib.ignore to contextlib.suppress

2013-10-16 Thread Raymond Hettinger
Raymond Hettinger added the comment: On Oct 16, 2013, at 3:55 PM, R. David Murray wrote: > Catch would be fine with me :) I like "catch". Raymond -- ___ Python tracker ___ __

[issue19266] Rename contextlib.ignore to contextlib.suppress

2013-10-16 Thread R. David Murray
R. David Murray added the comment: To be clear: I do think 'suppress' is better than 'ignore', for the reasons Nick articulated. -- ___ Python tracker ___ __

[issue19266] Rename contextlib.ignore to contextlib.suppress

2013-10-16 Thread R. David Murray
R. David Murray added the comment: Yes, in this context ingnore, suppress, and silence all have essentially the same problem, or lack of it, depending on your point of view. Catch would be fine with me :) Please note that someone *reading the thread* on python-dev misunderstood what ignore di

[issue19266] Rename contextlib.ignore to contextlib.suppress

2013-10-16 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: > Please give some weight to the fact the ignore() was > checked in for seven months, ... +1 -- nosy: +belopolsky ___ Python tracker ___

[issue19266] Rename contextlib.ignore to contextlib.suppress

2013-10-16 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- dependencies: +Add context manager for the "try: ... except: pass" pattern ___ Python tracker ___ ___

[issue19266] Rename contextlib.ignore to contextlib.suppress

2013-10-16 Thread Stefan Krah
Stefan Krah added the comment: Zero Piraeus wrote: > 'Ignore' and 'suppress' are not synonyms: I wrote "synonyms here", meaning that in *this context* they are practically synonyms. "suppress" describes the mechanics more precisely, "ignore" descibes the human intent: suppress_and_thereby_ignor

[issue19266] Rename contextlib.ignore to contextlib.suppress

2013-10-16 Thread Zero Piraeus
Zero Piraeus added the comment: 'Ignore' and 'suppress' are not synonyms: https://www.google.com/search?q=define%3Asuppress > forcibly put an end to. > "the rising was savagely suppressed" > synonyms: subdue, repress, crush, quell, quash, squash, stamp out https://www.google.com/search?q=defin

[issue19266] Rename contextlib.ignore to contextlib.suppress

2013-10-16 Thread Stefan Krah
Stefan Krah added the comment: trap() is a bit ambiguous, since in floating point operations it means that something is actually raised and not suppressed. So one could write: from decimal import * c = getcontext() c.traps[Inexact] = True >>> Decimal(9) / 11 # raises now! with trap(Inexact):

[issue19266] Rename contextlib.ignore to contextlib.suppress

2013-10-16 Thread Raymond Hettinger
Raymond Hettinger added the comment: I oppose abort_on() because it implies that it aborts the program. The word trap() is accurate but will be weird-sounding and non-communicative to users without a CS background: with trap(sqlite3.OperationalError): cursor.execute('CREATE TABLE d

[issue19266] Rename contextlib.ignore to contextlib.suppress

2013-10-16 Thread STINNER Victor
STINNER Victor added the comment: On python-dev, abort_on() and trap() were proposed. -- nosy: +haypo ___ Python tracker ___ ___ Pytho

[issue19266] Rename contextlib.ignore to contextlib.suppress

2013-10-16 Thread Raymond Hettinger
Raymond Hettinger added the comment: After more thought, I think that suppress() isn't as clear as ignore() and it doesn't read as well in typical use cases. I'm assigning this one back to Nick to decide. If you want to scan existing code for examples to see how well this would read, run thi

[issue19266] Rename contextlib.ignore to contextlib.suppress

2013-10-15 Thread Raymond Hettinger
Raymond Hettinger added the comment: This patch looks fine. I'll apply it shortly. -- assignee: -> rhettinger ___ Python tracker ___ ___

[issue19266] Rename contextlib.ignore to contextlib.suppress

2013-10-15 Thread Zero Piraeus
Zero Piraeus added the comment: > Zero, if you could review and sign the contributor agreement, that > would be great: http://www.python.org/psf/contrib/contrib-form/ Done :-) -- ___ Python tracker ___

[issue19266] Rename contextlib.ignore to contextlib.suppress

2013-10-15 Thread Nick Coghlan
Nick Coghlan added the comment: Zero's patch looks good to me, but it may be a couple of days before I can get to applying it. If anyone else can handle it before then, please feel free :) Also, Zero, if you could review and sign the contributor agreement, that would be great: http://www.pytho

[issue19266] Rename contextlib.ignore to contextlib.suppress

2013-10-15 Thread Zero Piraeus
Zero Piraeus added the comment: This is my first submitted patch; if there's anything wrong with it, please let me know (but the testsuite passes, and make patchcheck only warns about Misc/NEWS and Misc/ACKS, which I assume is handled by committer). -- keywords: +patch nosy: +zero.pira

[issue19266] Rename contextlib.ignore to contextlib.suppress

2013-10-15 Thread Barry A. Warsaw
Changes by Barry A. Warsaw : -- nosy: +barry ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pytho

[issue19266] Rename contextlib.ignore to contextlib.suppress

2013-10-15 Thread Nick Coghlan
Nick Coghlan added the comment: The specific docs quotes that persuaded me "suppress" was a better name than "ignore" for this feature (by contrast, "ignore" in this sense only appears in its own docs): >From http://docs.python.org/dev/library/stdtypes.html#contextmanager.__exit__: "Exit the

[issue19266] Rename contextlib.ignore to contextlib.suppress

2013-10-15 Thread Nick Coghlan
New submission from Nick Coghlan: Issue 15806 added contextlib.ignored to the standard library (later renamed to contextlib.ignore), as a simple helper that allows code like: try: os.remove(fname) except FileNotFoundError: pass to instead be written as: with ignore