Commit Graph

63 Commits

Author SHA1 Message Date
Tim Burke ecc23ea8c1
PEP 343: Clean up some __context__ context (#1631)
Clarify when the __context__() function was removed from the API; the
projected 2.5a3 tag never happened.

Also remove __context__() from example code.
2020-10-12 16:11:32 -07:00
Jeffrey Dorrycott 2c13570115 Update link to Raymond Chen's blog post (#1147) 2019-08-22 12:00:59 -07:00
Mariatta cf3bad5ab3
Revert "Rename all .txt PEP files to .rst (GH-462)" (GH-464)
This reverts commit bb0e518ed3.
2017-11-11 11:28:55 -08:00
Huang Huang bb0e518ed3 Rename all .txt PEP files to .rst (GH-462)
For https://github.com/python/peps/issues/1
2017-11-11 10:30:43 -08:00
Huang Huang 0d93a6344c reSTify PEP 343 (#320) 2017-08-14 11:11:09 -07:00
Benjamin Peterson 60d9b24542 promote m.p.o links to https 2017-06-11 12:02:39 -07:00
Serhiy Storchaka a53392a0f0 Remove trailing spaces. (#232)
Changes made automatically by the following command:
```
egrep -l ' +$' *.txt | xargs sed -i -re 's/ +$//'
```
2017-03-24 23:11:33 +02:00
Marti Raudsepp 04a6af2ab1 Fix various typos, spelling and grammar errors
Errors detected using Topy (https://github.com/intgr/topy), all changes
verified by hand.
2016-07-11 18:35:35 +03:00
Nick Coghlan 2b799e8d15 Add a couple of missing Python version headers 2011-06-13 01:39:23 +10:00
Georg Brandl 8a1e5adb10 #11248: look up special methods on type. 2011-03-20 21:51:37 +00:00
Nick Coghlan 12bfa7c87f The PEP 343 implementation for the beta releases seems to have met with general approval (PEP 0 has actually been showing 343 as being Final for ages) 2006-07-30 12:19:23 +00:00
Nick Coghlan 10535b0182 Address some comments from Guido by cutting back on the overengineering in the terminology section. Also a few minor grammar cleanups and fixes I missed last night. 2006-05-03 09:41:53 +00:00
David Goodger e4f531296c changed encoding to UTF-8; added emacs stanza 2006-05-02 18:01:35 +00:00
Nick Coghlan 15948f5fe0 Remove the __context__ method from PEP 343, and update the terminology section (again). Record a couple of remaining open issues, and try to clarify the resolved issues sections by only giving a very brief overview of all the rejected options that aren't relevant any more. 2006-05-02 14:28:47 +00:00
Nick Coghlan c854ad6eb9 Correct a bug in the nested() example 2006-04-24 04:41:45 +00:00
Nick Coghlan d36c583656 Change proposed terminology from context object to context specifier 2006-04-24 03:22:30 +00:00
Nick Coghlan db32145d0e Clarify the original meanings I intended for various terms, and record the fact that gaining consensus on the terminology is still an open issue 2006-04-23 05:14:10 +00:00
Phillip J. Eby 453a6c7d77 Make "context" vs. "context manager" terminology consistent.
Originally, there were only context managers, so a lot of text referred
to context managers that now should refer to contexts since the
__context__ method was added.  All contexts are context managers, so
these references were technically correct in some sense, but are
easier to understand if the more-specific terms are used.
2006-04-18 18:55:17 +00:00
Phillip J. Eby 47e612f17c More info on the __exit__ return issue, per Guido's request 2006-03-25 04:31:37 +00:00
Phillip J. Eby 0d09dd2a6a Document the difference between a normal return from __exit__() and an
exception return.  Fix a problem with @contextmanager not detecting
a broken generator that yields after a throw().  Make @contextmanager
not reraise exceptions, but return a false value in that case instead.
2006-03-25 00:26:26 +00:00
Guido van Rossum f6659b5348 Update this PEP to reflect the new design: exceptions are swallowed only
when __exit__ returns a true value.
2006-03-09 17:39:53 +00:00
Hye-Shik Chang 5104007210 Fix an apparent typo in the expanded code. 2006-03-03 06:39:47 +00:00
Guido van Rossum 1b6075f020 343: fix bug in nested().
356: add some tentative future keywords.
3000: add some new ideas.
2006-03-01 17:06:46 +00:00
Guido van Rossum 1b6c373966 Fix two examples that were broken by the new semantics. 2006-02-28 22:49:15 +00:00
Neal Norwitz afdd996d22 Minor detail about the warning 2006-02-28 21:13:18 +00:00
Guido van Rossum d8e895c878 Clarify the expanded code -- exc is just used as a flag. 2006-02-28 21:05:40 +00:00
Guido van Rossum f038797f00 Change the PEP to add that __exit__() must re-raise the exception
passed in, if any.  This appears to be a deviation from how the PEP
was originally seen; but I think it's essential to be able to make a
simple promise about generators decorated with @contextmanager.

Added the transition plan and the __future__ statement.

Also some miscellaneous cleanup.
2006-02-28 20:58:17 +00:00
Guido van Rossum 53c1f1795e Change the translation slightly.
ctx.__exit__ is now bound before ctx.__enter__;
ctx.__enter__ is still called before the try-block
is entered, but VAR is assigned *inside* the try-block.
Clarify what happens to break, continue, return.
2006-02-27 21:08:43 +00:00
Neal Norwitz 80bb3418b1 Fix a few small issues. opening() is introduced later. 2006-02-20 22:24:44 +00:00
Neal Norwitz f860cb242a Guido accepted 342 and 343 at EuroPython keynote. 342 was commited. 2006-02-08 06:22:22 +00:00
Nick Coghlan 781dcd1b39 Update with outcome of recent python-dev discussions 2005-10-29 06:08:12 +00:00
Nick Coghlan 28b01bed0e Revert PEP 343 to draft status until Guido is happy with the update 2005-10-17 09:15:06 +00:00
Nick Coghlan 1ddf93a58c Change name of PEP 343 to something less interesting but more obviously descriptive 2005-10-16 07:35:50 +00:00
Nick Coghlan a4e8e16f80 Update PEP 343 to reflect post-acceptance python-dev discussions 2005-10-16 07:30:17 +00:00
Guido van Rossum cc0bfb59f2 Rename class ContextManager to ContextWrapper, per Nick's proposal. 2005-07-12 16:28:56 +00:00
Guido van Rossum f2d367de26 Rename @with_template and class Wrapper to @contextmanager and class
ContextManager.  Mark open issues as resolved.
2005-07-12 16:27:53 +00:00
Raymond Hettinger 95fd996744 Mark 342 and 343 as accepted. Mark 254 as abandoned. 2005-06-28 07:39:09 +00:00
Phillip J. Eby 5b3f4e8ce0 PEP 343: Remove functionality now covered under PEP 342. 2005-06-26 02:21:21 +00:00
Raymond Hettinger 461d444be3 Optional arguments for throw() to match raise syntax 2005-06-17 21:58:59 +00:00
Guido van Rossum a61abd2828 Restrict 'as VAR' to VAR being a single variable or a parenthesized
series of variables.  This keeps the door open for a future extension
with multiple as-clauses.
2005-06-11 05:14:20 +00:00
Guido van Rossum b69c21f1e7 Add Wiki link. 2005-06-06 17:15:17 +00:00
Michael W. Hudson 9893f796ea Incredibly minor clarification. 2005-06-03 09:32:57 +00:00
Guido van Rossum 235d1d29e2 Include suggestions from Nick Coghlan. 2005-06-02 15:13:55 +00:00
Guido van Rossum 787d7a1050 Raise RuntimeError in close(). Add list of open issues. 2005-06-02 14:56:36 +00:00
Guido van Rossum b71b1ff13d List PEPs that can be rejected once this is accepted. This turned up
a surprise: PEP 319.
2005-06-01 21:01:11 +00:00
Guido van Rossum c76b8b40fc Address most of Phillip Eby's comments. 2005-06-01 16:45:25 +00:00
Guido van Rossum a942512355 Specify generator enhancements. Change keyword to 'with'. 2005-06-01 15:13:37 +00:00
Guido van Rossum 0c4151b242 Warn readers of coming attractions. 2005-05-31 20:27:15 +00:00
Guido van Rossum a9a33511f4 More generic decimal example. 2005-05-18 14:24:27 +00:00
Guido van Rossum 324efa3d31 Outdent "return +s" and explain why. Thanks Raymond! 2005-05-18 03:58:29 +00:00