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

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

Issue 11682: PEP 380 reference implementation for 3.3
Patch Set: Created 7 years, 7 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
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 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 can now be written without the :mod:`errno` import and without manual 186 can now be written without the :mod:`errno` import and without manual
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
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)
196 212
197 213
198 PEP 3155: Qualified name for classes and functions 214 PEP 3155: Qualified name for classes and functions
199 ================================================== 215 ==================================================
200 216
201 :pep:`3155` - Qualified name for classes and functions 217 :pep:`3155` - Qualified name for classes and functions
202 PEP written and implemented by Antoine Pitrou. 218 PEP written and implemented by Antoine Pitrou.
203 219
204 Functions and class objects have a new ``__qualname__`` attribute representing 220 Functions and class objects have a new ``__qualname__`` attribute representing
205 the "path" from the module top-level to their definition. For global functions 221 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, 222 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 223 it provides better information about where they were actually defined, and
208 how they might be accessible from the global scope. 224 how they might be accessible from the global scope.
209 225
210 Example with (non-bound) methods:: 226 Example with (non-bound) methods::
211
212 >>> class C: 227 >>> class C:
213 ... def meth(self): 228 ... def meth(self):
214 ... pass 229 ... pass
215 >>> C.meth.__name__ 230 >>> C.meth.__name__
216 'meth' 231 'meth'
217 >>> C.meth.__qualname__ 232 >>> C.meth.__qualname__
218 'C.meth' 233 'C.meth'
219 234
220 Example with nested classes:: 235 Example with nested classes::
221 236
(...skipping 674 matching lines...) Expand 10 before | Expand all | Expand 10 after
896 ------------ 911 ------------
897 912
898 .. Issue #11591: When :program:`python` was started with :option:`-S`, 913 .. Issue #11591: When :program:`python` was started with :option:`-S`,
899 ``import site`` will not add site-specific paths to the module search 914 ``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 915 paths. In previous versions, it did. See changeset for doc changes in
901 various files. Contributed by Carl Meyer with editions by Éric Araujo. 916 various files. Contributed by Carl Meyer with editions by Éric Araujo.
902 917
903 .. Issue #10998: the -Q command-line flag and related artifacts have been 918 .. Issue #10998: the -Q command-line flag and related artifacts have been
904 removed. Code checking sys.flags.division_warning will need updating. 919 removed. Code checking sys.flags.division_warning will need updating.
905 Contributed by Éric Araujo. 920 Contributed by Éric Araujo.
OLDNEW
« no previous file with comments | « Doc/reference/simple_stmts.rst ('k') | Grammar/Grammar » ('j') | Modules/parsermodule.c » ('J')

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