Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0acceb7

Browse files
committed
What's New updates prior to alpha
1 parent 4dae27a commit 0acceb7

2 files changed

Lines changed: 63 additions & 11 deletions

File tree

Doc/library/contextlib.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -597,9 +597,10 @@ an explicit ``with`` statement.
597597
The specification, background, and examples for the Python :keyword:`with`
598598
statement.
599599

600+
.. _single-use-reusable-and-reentrant-cms:
600601

601-
Reusable and reentrant context managers
602-
---------------------------------------
602+
Single use, reusable and reentrant context managers
603+
---------------------------------------------------
603604

604605
Most context managers are written in a way that means they can only be
605606
used effectively in a :keyword:`with` statement once. These single use

Doc/whatsnew/3.4.rst

Lines changed: 60 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -86,13 +86,15 @@ Summary -- Release highlights
8686
8787
New syntax features:
8888

89-
* None yet.
89+
* No new syntax features are planned for Python 3.4.
9090

9191
New library modules:
9292

93-
* :mod:`enum`: Implementation of the :pep:`435`.
93+
* :mod:`asyncio`: New provisonal API for asynchronous IO (:pep:`3156`).
94+
* :mod:`enum`: Support for enumeration types (:pep:`435`).
9495
* :mod:`selectors`: High-level and efficient I/O multiplexing, built upon the
9596
:mod:`select` module primitives.
97+
* :mod:`statistics`: A basic numerically stable statistics library (:pep:`450`).
9698

9799
New built-in features:
98100

@@ -105,6 +107,8 @@ Implementation improvements:
105107
* A more efficient :mod:`marshal` format (:issue:`16475`).
106108
* Improve finalization of Python modules to avoid setting their globals
107109
to None, in most cases (:issue:`18214`).
110+
* "Argument Clinic", providing improved introspection support for builtin
111+
and standard library extension types implemented in C (:pep:`436`)
108112

109113
Significantly Improved Library Modules:
110114

@@ -176,15 +180,50 @@ Some smaller changes made to the core Python language are:
176180

177181
* Module objects are now :mod:`weakref`'able.
178182

183+
* Module ``__file__`` attributes (and related values) should now always
184+
contain absolute paths by default, with the sole exception of
185+
``__main__.__file__`` when a script has been executed directly using
186+
a relative path (Contributed by Brett Cannon in :issue:`18416`).
187+
179188

180189
New Modules
181190
===========
182191

192+
193+
asyncio
194+
-------
195+
196+
The new :mod:`asyncio` module (defined in :pep:`3156`) provides a standard
197+
pluggable event loop model for Python, providing solid asynchronous IO
198+
support in the standard library, and making it easier for other event loop
199+
implementations to interoperate with the standard library and each other.
200+
201+
For Python 3.4, this module is considered a :term:`provisional API`.
202+
203+
enum
204+
----
205+
206+
The new :mod:`enum` module provides a standard implementation of enumeration
207+
types, allowing other modules (such as :mod:`socket`) to provide more
208+
informative error messages and better debugging support by replacing opaque
209+
integer constants with backwards compatible enumeration values.
210+
211+
183212
selectors
184213
---------
185214

186-
The new :mod:`selectors` module allows high-level and efficient I/O
187-
multiplexing, built upon the :mod:`select` module primitives.
215+
The new :mod:`selectors` module (created as part of implementing :pep:`3156`)
216+
allows high-level and efficient I/O multiplexing, built upon the
217+
:mod:`select` module primitives.
218+
219+
220+
statistics
221+
----------
222+
223+
The new :mod:`statistics` module (defined in :pep:`450`) offers some core
224+
statistics functionality directly in the standard library. This module
225+
supports calculation of the mean, median, mode, variance and standard
226+
deviation of a data series.
188227

189228

190229
Improved Modules
@@ -232,12 +271,16 @@ intent of code that deliberately suppresses exceptions from a single
232271
statement. (Contributed by Raymond Hettinger in :issue:`15806` and
233272
Zero Piraeus in :issue:`19266`)
234273

235-
236274
The new :class:`contextlib.redirect_stdio` context manager makes it easier
237275
for utility scripts to handle inflexible APIs that don't provide any
238276
options to retrieve their output as a string or direct it to somewhere
239-
other than :data:`sys.stdout`. (Contribute by Raymond Hettinger in
240-
:issue:`15805`)
277+
other than :data:`sys.stdout`. In conjunction with :class:`io.StringIO`,
278+
this context manager is also useful for checking expected output from
279+
command line utilities. (Contribute by Raymond Hettinger in :issue:`15805`)
280+
281+
The :mod:`contextlib` documentation has also been updated to include a
282+
:ref:`discussion <single-use-reusable-and-reentrant-cms>` of the
283+
differences between single use, reusable and reentrant context managers.
241284

242285

243286
dis
@@ -567,7 +610,6 @@ Major performance enhancements have been added:
567610
:issue:`9548`)
568611

569612

570-
571613
Build and C API Changes
572614
=======================
573615

@@ -578,6 +620,15 @@ Changes to Python's build process and to the C API include:
578620
a particular encoding and error handler for the standard streams
579621
(Contributed by Bastien Montagne and Nick Coghlan in :issue:`16129`)
580622

623+
* Most Python C APIs that don't mutate string arguments are now correctly
624+
marked as accepting ``const char *`` rather than ``char *`` (Contributed
625+
by Serhiy Storchaka in :issue:`1772673`).
626+
627+
* "Argument Clinic" (:pep:`436`) is now part of the CPython build process
628+
and can be used to simplify the process of defining and maintaining
629+
accurate signatures for builtins and standard library extension modules
630+
implemented in C.
631+
581632

582633
Deprecated
583634
==========
@@ -618,7 +669,7 @@ Deprecated functions and types of the C API
618669
Deprecated features
619670
-------------------
620671

621-
* None yet.
672+
* No feature deprecations are planned for Python 3.4.
622673

623674

624675
Porting to Python 3.4

0 commit comments

Comments
 (0)