发布于 2017-03-11 13:57:43 | 219 次阅读 | 评论: 0 | 来源: 网友投递
这里有新鲜出炉的Python3 Cookbook中文版,程序狗速度看过来!
Python编程语言
Python 是一种面向对象、解释型计算机程序设计语言,由Guido van Rossum于1989年底发明,第一个公开发行版发行于1991年。Python语法简洁而清晰,具有丰富和强大的类库。它常被昵称为胶水语言,它能够把用其他语言制作的各种模块(尤其是C/C++)很轻松地联结在一起。
Python 3.6.1 RC1 发布了,正式版计划在 3月20日 发布。
下载地址:https://www.python.org/downloads/release/python-361rc1/
详细改进记录包括:
bpo-28893: Set correct __cause__ for errors about invalid awaitables returned from __aiter__ and __anext__.
bpo-29683: Fixes to memory allocation in _PyCode_SetExtra. Patch by Brian Coleman.
bpo-29684: Fix minor regression of PyEval_CallObjectWithKeywords. It should raise TypeError when kwargs is not a dict. But it might cause segv when args=NULL and kwargs is not a dict.
bpo-28598: Support __rmod__ for subclasses of str being called before str.__mod__. Patch by Martijn Pieters.
bpo-29572: Update Windows build and OS X installers to use OpenSSL 1.0.2k.
bpo-29607: Fix stack_effect computation for CALL_FUNCTION_EX. Patch by Matthieu Dartiailh.
bpo-29602: Fix incorrect handling of signed zeros in complex constructor for complex subclasses and for inputs having a __complex__ method. Patch by Serhiy Storchaka.
bpo-29347: Fixed possibly dereferencing undefined pointers when creating weakref objects.
bpo-29438: Fixed use-after-free problem in key sharing dict.
bpo-29319: Prevent RunMainFromImporter overwriting sys.path[0].
bpo-29337: Fixed possible BytesWarning when compare the code objects. Warnings could be emitted at compile time.
bpo-29327: Fixed a crash when pass the iterable keyword argument to sorted().
bpo-29034: Fix memory leak and use-after-free in os module (path_converter).
bpo-29159: Fix regression in bytes(x) when x.__index__() raises Exception.
bpo-28932: Do not include <sys/random.h> if it does not exist.
bpo-25677: Correct the positioning of the syntax error caret for indented blocks. Based on patch by Michael Layzell.
bpo-29000: Fixed bytes formatting of octals with zero padding in alternate form.
bpo-26919: On Android, operating system data is now always encoded/decoded to/from UTF-8, instead of the locale encoding to avoid inconsistencies with os.fsencode() and os.fsdecode() which are already using UTF-8.
bpo-28991: functools.lru_cache() was susceptible to an obscure reentrancy bug triggerable by a monkey-patched len() function.
bpo-28739: f-string expressions are no longer accepted as docstrings and by ast.literal_eval() even if they do not include expressions.
bpo-28512: Fixed setting the offset attribute of SyntaxError by PyErr_SyntaxLocationEx() and PyErr_SyntaxLocationObject().
bpo-28918: Fix the cross compilation of xxlimited when Python has been built with Py_DEBUG defined.
bpo-28731: Optimize _PyDict_NewPresized() to create correct size dict. Improve speed of dict literal with constant keys up to 30%.
bpo-29169: Update zlib to 1.2.11.
bpo-29623: Allow use of path-like object as a single argument in ConfigParser.read(). Patch by David Ellis.
bpo-28963: Fix out of bound iteration in asyncio.Future.remove_done_callback implemented in C.
bpo-29704: asyncio.subprocess.SubprocessStreamProtocol no longer closes before all pipes are closed.
bpo-29271: Fix Task.current_task and Task.all_tasks implemented in C to accept None argument as their pure Python implementation.
bpo-29703: Fix asyncio to support instantiation of new event loops in child processes.
bpo-29376: Fix assertion error in threading._DummyThread.is_alive().
bpo-28624: Add a test that checks that cwd parameter of Popen() accepts PathLike objects. Patch by Sayan Chowdhury.
bpo-28518: Start a transaction implicitly before a DML statement. Patch by Aviv Palivoda.
bpo-29532: Altering a kwarg dictionary passed to functools.partial() no longer affects a partial object after creation.
bpo-29110: Fix file object leak in aifc.open() when file is given as a filesystem path and is not in valid AIFF format. Patch by Anthony Zhang.
bpo-24932: Use proper command line parsing in _testembed
bpo-28556: Various updates to typing module: typing.Counter, typing.ChainMap, improved ABC caching, etc. Original PRs by Jelle Zijlstra, Ivan Levkivskyi, Manuel Krebber, and Łukasz Langa.
bpo-29100: Fix datetime.fromtimestamp() regression introduced in Python 3.6.0: check minimum and maximum years.
bpo-29519: Fix weakref spewing exceptions during interpreter shutdown when used with a rare combination of multiprocessing and custom codecs.
bpo-29416: Prevent infinite loop in pathlib.Path.mkdir
bpo-29444: Fixed out-of-bounds buffer access in the group() method of the match object. Based on patch by WGH.
bpo-29335: Fix subprocess.Popen.wait() when the child process has exited to a stopped instead of terminated state (ex: when under ptrace).
bpo-29290: Fix a regression in argparse that help messages would wrap at non-breaking spaces.
bpo-28735: Fixed the comparison of mock.MagickMock with mock.ANY.
bpo-29316: Restore the provisional status of typing module, add corresponding note to documentation. Patch by Ivan L.
bpo-29219: Fixed infinite recursion in the repr of uninitialized ctypes.CDLL instances.
bpo-29011: Fix an important omission by adding Deque to the typing module.
bpo-28969: Fixed race condition in C implementation of functools.lru_cache. KeyError could be raised when cached function with full cache was simultaneously called from differen threads with the same uncached arguments.
bpo-29142: In urllib.request, suffixes in no_proxy environment variable with leading dots could match related hostnames again (e.g. .b.c matches a.b.c). Patch by Milan Oberkirch.
bpo-28961: Fix unittest.mock._Call helper: don’t ignore the name parameter anymore. Patch written by Jiajun Huang.
bpo-29203: functools.lru_cache() now respects PEP 468 and preserves the order of keyword arguments. f(a=1, b=2) is now cached separately from f(b=2, a=1) since both calls could potentially give different results.
bpo-15812: inspect.getframeinfo() now correctly shows the first line of a context. Patch by Sam Breese.
bpo-29094: Offsets in a ZIP file created with extern file object and modes “w” and “x” now are relative to the start of the file.
bpo-29085: Allow random.Random.seed() to use high quality OS randomness rather than the pid and time.
bpo-29061: Fixed bug in secrets.randbelow() which would hang when given a negative input. Patch by Brendan Donegan.
bpo-29079: Prevent infinite loop in pathlib.resolve() on Windows
bpo-13051: Fixed recursion errors in large or resized curses.textpad.Textbox. Based on patch by Tycho Andersen.
bpo-29119: Fix weakrefs in the pure python version of collections.OrderedDict move_to_end() method. Contributed by Andra Bogildea.
bpo-9770: curses.ascii predicates now work correctly with negative integers.
bpo-28427: old keys should not remove new values from WeakValueDictionary when collecting from another thread.
Issue 28923: Remove editor artifacts from Tix.py.
bpo-29055: Neaten-up empty population error on random.choice() by suppressing the upstream exception.
bpo-28871: Fixed a crash when deallocate deep ElementTree.
bpo-19542: Fix bugs in WeakValueDictionary.setdefault() and WeakValueDictionary.pop() when a GC collection happens in another thread.
bpo-20191: Fixed a crash in resource.prlimit() when passing a sequence that doesn’t own its elements as limits.
bpo-28779: multiprocessing.set_forkserver_preload() would crash the forkserver process if a preloaded module instantiated some multiprocessing objects such as locks.
bpo-28847: dbm.dumb now supports reading read-only files and no longer writes the index file when it is not changed.
bpo-26937: The chown() method of the tarfile.TarFile class does not fail now when the grp module cannot be imported, as for example on Android platforms.
bpo-29579: Removes readme.txt from the installer
bpo-29326: Ignores blank lines in ._pth files (Patch by Alexey Izbyshev)
bpo-28164: Correctly handle special console filenames (patch by Eryk Sun)
bpo-29409: Implement PEP 529 for io.FileIO (Patch by Eryk Sun)
bpo-29392: Prevent crash when passing invalid arguments into msvcrt module.
bpo-25778: winreg does not truncate string correctly (Patch by Eryk Sun)
bpo-28896: Deprecate WindowsRegistryFinder and disable it by default.
bpo-27867: Function PySlice_GetIndicesEx() is replaced with a macro if Py_LIMITED_API is not set or set to the value between 0x03050400 and 0x03060000 (not including) or 0x03060100 or higher.
bpo-29083: Fixed the declaration of some public API functions. PyArg_VaParse() and PyArg_VaParseTupleAndKeywords() were not available in limited API. PyArg_ValidateKeywordArguments(), PyArg_UnpackTuple() and Py_BuildValue() were not available in limited API of version < 3.3 when PY_SSIZE_T_CLEAN is defined.
bpo-29058: All stable API extensions added after Python 3.2 are now available only when Py_LIMITED_API is set to the PY_VERSION_HEX value of the minimum Python version supporting this API.
bpo-28929: Link the documentation to its source file on GitHub.
bpo-25008: Document smtpd.py as effectively deprecated and add a pointer to aiosmtpd, a third-party asyncio-based replacement.
bpo-26355: Add canonical header link on each page to corresponding major version of the documentation. Patch by Matthias Bussonnier.
bpo-29349: Fix Python 2 syntax in code for building the documentation.
bpo-28087: Skip test_asyncore and test_eintr poll failures on macOS. Skip some tests of select.poll when running on macOS due to unresolved issues with the underlying system poll function on some macOS versions.
bpo-29571: to match the behaviour of the re.LOCALE
flag, test_re.test_locale_flag now uses locale.getpreferredencoding(False)
to determine the candidate encoding for the test regex (allowing it to correctly skip the test when the default locale encoding is a multi-byte encoding)
bpo-28950: Disallow -j0 to be combined with -T/-l in regrtest command line arguments.
bpo-28683: Fix the tests that bind() a unix socket and raise PermissionError on Android for a non-root user.
bpo-26939: Add the support.setswitchinterval() function to fix test_functools hanging on the Android armv7 qemu emulator.
bpo-27593: sys.version and the platform module python_build(), python_branch(), and python_revision() functions now use git information rather than hg when building from a repo.
bpo-29572: Update Windows build and OS X installers to use OpenSSL 1.0.2k.
bpo-26851: Set Android compilation and link flags.
bpo-28768: Fix implicit declaration of function _setmode. Patch by Masayuki Yamamoto
bpo-29080: Removes hard dependency on hg.exe from PCBuild/build.bat
bpo-23903: Added missed names to PC/python3.def.
bpo-28762: lockf() is available on Android API level 24, but the F_LOCK macro is not defined in android-ndk-r13.
bpo-28538: Fix the compilation error that occurs because if_nameindex() is available on Android API level 24, but the if_nameindex structure is not defined.
bpo-20211: Do not add the directory for installing C header files and the directory for installing object code libraries to the cross compilation search paths. Original patch by Thomas Petazzoni.
bpo-28849: Do not define sys.implementation._multiarch on Android.