Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(107488)

Side by Side Diff: Doc/whatsnew/3.3.rst

Issue 11682: PEP 380 reference implementation for 3.3
Patch Set: Created 7 years, 10 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Doc/reference/simple_stmts.rst ('k') | Grammar/Grammar » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 **************************** 1 ****************************
2 What's New In Python 3.3 2 What's New In Python 3.3
3 **************************** 3 ****************************
4 4
5 :Author: Raymond Hettinger 5 :Author: Raymond Hettinger
6 :Release: |release| 6 :Release: |release|
7 :Date: |today| 7 :Date: |today|
8 8
9 .. Rules for maintenance: 9 .. Rules for maintenance:
10 10
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 inspection of exception attributes:: 187 inspection of exception attributes::
188 188
189 try: 189 try:
190 with open("document.txt") as f: 190 with open("document.txt") as f:
191 content = f.read() 191 content = f.read()
192 except FileNotFoundError: 192 except FileNotFoundError:
193 print("document.txt file is missing") 193 print("document.txt file is missing")
194 except PermissionError: 194 except PermissionError:
195 print("You are not allowed to read document.txt") 195 print("You are not allowed to read document.txt")
196 196
197
198 PEP 380: Syntax for Delegating to a Subgenerator
199 ================================================
200
201 PEP 380 adds the ``yield from`` expression, allowing a generator to delegate
202 part of its operations to another generator. This allows a section of code
203 containing 'yield' to be factored out and placed in another generator.
204 Additionally, the subgenerator is allowed to return with a value, and the
205 value is made available to the delegating generator.
206 While designed primarily for use in delegating to a subgenerator, the ``yield
207 from`` expression actually allows delegation to arbitrary subiterators.
208
209 (Implementation by Greg Ewing, integrated into 3.3 by Renaud Blanch, Ryan
210 Kelly and Nick Coghlan, documentation by Zbigniew Jędrzejewski-Szmek and
211 Nick Coghlan)
197 212
198 PEP 3155: Qualified name for classes and functions 213 PEP 3155: Qualified name for classes and functions
199 ================================================== 214 ==================================================
200 215
201 :pep:`3155` - Qualified name for classes and functions 216 :pep:`3155` - Qualified name for classes and functions
202 PEP written and implemented by Antoine Pitrou. 217 PEP written and implemented by Antoine Pitrou.
203 218
204 Functions and class objects have a new ``__qualname__`` attribute representing 219 Functions and class objects have a new ``__qualname__`` attribute representing
205 the "path" from the module top-level to their definition. For global functions 220 the "path" from the module top-level to their definition. For global functions
206 and classes, this is the same as ``__name__``. For other functions and classes, 221 and classes, this is the same as ``__name__``. For other functions and classes,
207 it provides better information about where they were actually defined, and 222 it provides better information about where they were actually defined, and
208 how they might be accessible from the global scope. 223 how they might be accessible from the global scope.
209 224
210 Example with (non-bound) methods:: 225 Example with (non-bound) methods::
211
212 >>> class C: 226 >>> class C:
213 ... def meth(self): 227 ... def meth(self):
214 ... pass 228 ... pass
215 >>> C.meth.__name__ 229 >>> C.meth.__name__
216 'meth' 230 'meth'
217 >>> C.meth.__qualname__ 231 >>> C.meth.__qualname__
218 'C.meth' 232 'C.meth'
219 233
220 Example with nested classes:: 234 Example with nested classes::
221 235
(...skipping 674 matching lines...) Expand 10 before | Expand all | Expand 10 after
896 ------------ 910 ------------
897 911
898 .. Issue #11591: When :program:`python` was started with :option:`-S`, 912 .. Issue #11591: When :program:`python` was started with :option:`-S`,
899 ``import site`` will not add site-specific paths to the module search 913 ``import site`` will not add site-specific paths to the module search
900 paths. In previous versions, it did. See changeset for doc changes in 914 paths. In previous versions, it did. See changeset for doc changes in
901 various files. Contributed by Carl Meyer with editions by Éric Araujo. 915 various files. Contributed by Carl Meyer with editions by Éric Araujo.
902 916
903 .. Issue #10998: the -Q command-line flag and related artifacts have been 917 .. Issue #10998: the -Q command-line flag and related artifacts have been
904 removed. Code checking sys.flags.division_warning will need updating. 918 removed. Code checking sys.flags.division_warning will need updating.
905 Contributed by Éric Araujo. 919 Contributed by Éric Araujo.
OLDNEW
« no previous file with comments | « Doc/reference/simple_stmts.rst ('k') | Grammar/Grammar » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+