summaryrefslogtreecommitdiffstats
path: root/Doc/whatsnew/2.6.rst
diff options
context:
space:
mode:
Diffstat (limited to 'Doc/whatsnew/2.6.rst')
-rw-r--r--Doc/whatsnew/2.6.rst67
1 files changed, 64 insertions, 3 deletions
diff --git a/Doc/whatsnew/2.6.rst b/Doc/whatsnew/2.6.rst
index b0e731a..dd537d3 100644
--- a/Doc/whatsnew/2.6.rst
+++ b/Doc/whatsnew/2.6.rst
@@ -73,6 +73,20 @@ Other Language Changes
Here are all of the changes that Python 2.6 makes to the core Python language.
+* The :func:`complex` constructor now accepts strings containing
+ parenthesized complex numbers, letting ``complex(repr(cmplx))``
+ will now round-trip values. For example, ``complex('(3+4j)')``
+ now returns the value (3+4j).
+
+ .. % Patch 1491866
+
+* The string :meth:`translate` method now accepts ``None`` as the
+ translation table parameter, which is treated as the identity
+ transformation. This makes it easier to carry out operations
+ that only delete characters. (Contributed by Bengt Richter.)
+
+ .. % Patch 1193128
+
* An obscure change: when you use the the :func:`locals` function inside a
:keyword:`class` statement, the resulting dictionary no longer returns free
variables. (Free variables, in this case, are variables referred to in the
@@ -124,6 +138,11 @@ complete list of changes, or look through the CVS logs for all the details.
(Contributed by Fabian Kreutz.)
+* An optional ``timeout`` parameter was added to the
+ :class:`ftplib.FTP` class constructor as well as the :meth:`connect`
+ method, specifying a timeout measured in seconds. (Added by Facundo
+ Batista.)
+
* The :func:`glob.glob` function can now return Unicode filenames if
a Unicode path was used and Unicode filenames are matched within the directory.
@@ -157,6 +176,21 @@ complete list of changes, or look through the CVS logs for all the details.
.. % Patch #1490190
+* In the :mod:`os.path` module, the :func:`splitext` function
+ has been changed to not split on leading period characters.
+ This produces better results when operating on Unix's dot-files.
+ For example, ``os.path.splitext('.ipython')``
+ now returns ``('.ipython', '')`` instead of ``('', '.ipython')``.
+
+ .. % Bug #115886
+
+ A new function, :func:`relpath(path, start)` returns a relative path
+ from the ``start`` path, if it's supplied, or from the current
+ working directory to the destination ``path``. (Contributed by
+ Richard Barran.)
+
+ .. % Patch 1339796
+
* New functions in the :mod:`posix` module: :func:`chflags` and :func:`lchflags`
are wrappers for the corresponding system calls (where they're available).
Constants for the flag values are defined in the :mod:`stat` module; some
@@ -166,14 +200,41 @@ complete list of changes, or look through the CVS logs for all the details.
* The :mod:`rgbimg` module has been removed.
-* The :mod:`smtplib` module now supports SMTP over SSL thanks to the addition
- of the :class:`SMTP_SSL` class. This class supports an interface identical to
- the existing :class:`SMTP` class. (Contributed by Monty Taylor.)
+* The :mod:`smtplib` module now supports SMTP over SSL thanks to the
+ addition of the :class:`SMTP_SSL` class. This class supports an
+ interface identical to the existing :class:`SMTP` class. Both
+ class constructors also have an optional ``timeout`` parameter
+ that specifies a timeout for the initial connection attempt, measured in
+ seconds.
+
+ An implementation of the LMTP protocol (:rfc:`2033`) was also added to
+ the module. LMTP is used in place of SMTP when transferring e-mail
+ between agents that don't manage a mail queue.
+
+ (SMTP over SSL contributed by Monty Taylor; timeout parameter
+ added by Facundo Batista; LMTP implemented by Leif
+ Hedstrom.)
+
+ .. % Patch #957003
+
+* An optional ``timeout`` parameter was added to the
+ :class:`telnetlib.Telnet` class constructor, specifying a timeout
+ measured in seconds. (Added by Facundo Batista.)
* The :mod:`test.test_support` module now contains a :func:`EnvironmentVarGuard`
context manager that supports temporarily changing environment variables and
automatically restores them to their old values. (Contributed by Brett Cannon.)
+* The :mod:`timeit` module now accepts callables as well as strings
+ for the statement being timed and for the setup code.
+ Two convenience functions were added for creating
+ :class:`Timer` instances:
+ ``repeat(stmt, setup, time, repeat, number)`` and
+ ``timeit(stmt, setup, time, number)`` create an instance and call
+ the corresponding method. (Contributed by Erik Demaine.)
+
+ .. % Patch #1533909
+
.. % ======================================================================
.. % whole new modules get described in \subsections here