summaryrefslogtreecommitdiffstats
path: root/lib/fonts
diff options
context:
space:
mode:
Diffstat (limited to 'lib/fonts')
0 files changed, 0 insertions, 0 deletions
4bf2866'>Doc/howto/logging-cookbook.rst4
-rw-r--r--Doc/library/2to3.rst4
-rw-r--r--Doc/library/abc.rst21
-rw-r--r--Doc/library/argparse.rst20
-rw-r--r--Doc/library/doctest.rst10
-rw-r--r--Doc/library/exceptions.rst6
-rw-r--r--Doc/library/gc.rst18
-rw-r--r--Doc/library/hashlib.rst10
-rw-r--r--Doc/library/http.server.rst3
-rw-r--r--Doc/library/importlib.rst155
-rw-r--r--Doc/library/json.rst31
-rw-r--r--Doc/library/logging.config.rst51
-rw-r--r--Doc/library/operator.rst8
-rw-r--r--Doc/library/os.path.rst1
-rw-r--r--Doc/library/os.rst2
-rw-r--r--Doc/library/poplib.rst27
-rw-r--r--Doc/library/pty.rst3
-rw-r--r--Doc/library/select.rst5
-rw-r--r--Doc/library/shutil.rst15
-rw-r--r--Doc/library/sys.rst18
-rw-r--r--Doc/library/sysconfig.rst2
-rw-r--r--Doc/library/timeit.rst2
-rw-r--r--Doc/library/tkinter.rst26
-rw-r--r--Doc/library/traceback.rst2
-rw-r--r--Doc/library/unicodedata.rst4
-rw-r--r--Doc/library/urllib.error.rst7
-rw-r--r--Doc/library/urllib.request.rst36
-rw-r--r--Doc/library/venv.rst5
-rw-r--r--Doc/library/weakref.rst29
-rw-r--r--Doc/license.rst21
-rw-r--r--Doc/reference/datamodel.rst9
-rw-r--r--Doc/tools/sphinxext/indexsidebar.html2
-rw-r--r--Doc/tools/sphinxext/pyspecific.py2
-rw-r--r--Doc/tutorial/interpreter.rst14
-rw-r--r--Doc/tutorial/modules.rst35
-rw-r--r--Doc/tutorial/stdlib.rst2
-rw-r--r--Doc/tutorial/stdlib2.rst2
-rw-r--r--Doc/using/venv-create.inc29
-rw-r--r--Doc/whatsnew/3.4.rst209
-rw-r--r--Doc/whatsnew/index.rst1
-rw-r--r--Include/Python-ast.h12
-rw-r--r--Include/abstract.h3
-rw-r--r--Include/asdl.h1
-rw-r--r--Include/grammar.h2
-rw-r--r--Include/object.h41
-rw-r--r--Include/objimpl.h4
-rw-r--r--Include/osdefs.h8
-rw-r--r--Include/patchlevel.h6
-rw-r--r--Include/pyport.h17
-rw-r--r--Include/sliceobject.h3
-rw-r--r--Include/symtable.h1
-rw-r--r--Include/token.h2
-rw-r--r--Include/unicodeobject.h29
-rw-r--r--LICENSE1
-rw-r--r--Lib/_osx_support.py2
-rw-r--r--Lib/abc.py6
-rw-r--r--Lib/argparse.py19
-rw-r--r--Lib/ast.py6
-rw-r--r--Lib/bz2.py44
-rw-r--r--Lib/collections/__init__.py3
-rw-r--r--Lib/collections/abc.py3
-rw-r--r--Lib/compileall.py2
-rw-r--r--Lib/concurrent/futures/_base.py3
-rw-r--r--Lib/concurrent/futures/process.py6
-rw-r--r--Lib/concurrent/futures/thread.py2
-rw-r--r--Lib/dbm/__init__.py6
-rw-r--r--Lib/decimal.py4
-rw-r--r--Lib/difflib.py21
-rw-r--r--Lib/distutils/__init__.py2
-rw-r--r--Lib/distutils/ccompiler.py5
-rw-r--r--Lib/distutils/command/bdist.py3
-rw-r--r--Lib/distutils/command/bdist_dumb.py8
-rw-r--r--Lib/distutils/command/build_ext.py26
-rw-r--r--Lib/distutils/command/install.py15
-rw-r--r--Lib/distutils/emxccompiler.py315
-rw-r--r--Lib/distutils/spawn.py24
-rw-r--r--Lib/distutils/sysconfig.py24
-rw-r--r--Lib/distutils/tests/test_bdist_dumb.py2
-rw-r--r--Lib/distutils/tests/test_install.py2
-rw-r--r--Lib/distutils/tests/test_util.py2
-rw-r--r--Lib/distutils/util.py6
-rw-r--r--Lib/doctest.py8
-rw-r--r--Lib/email/_header_value_parser.py3
-rw-r--r--Lib/email/iterators.py6
-rw-r--r--Lib/filecmp.py6
-rw-r--r--Lib/fractions.py14
-rw-r--r--Lib/functools.py28
-rw-r--r--Lib/getpass.py2
-rw-r--r--Lib/glob.py3
-rw-r--r--Lib/hashlib.py15
-rw-r--r--Lib/http/cookiejar.py3
-rw-r--r--Lib/http/server.py4
-rw-r--r--Lib/idlelib/FileList.py2
-rw-r--r--Lib/idlelib/GrepDialog.py2
-rw-r--r--Lib/idlelib/IOBinding.py2
-rw-r--r--Lib/idlelib/NEWS.txt2
-rw-r--r--Lib/idlelib/PathBrowser.py2
-rw-r--r--Lib/idlelib/PyShell.py10
-rw-r--r--Lib/idlelib/TreeWidget.py4
-rw-r--r--Lib/idlelib/help.txt2
-rw-r--r--Lib/idlelib/idlever.py2
-rw-r--r--Lib/importlib/_bootstrap.py23
-rw-r--r--Lib/importlib/abc.py177
-rw-r--r--Lib/json/__init__.py25
-rw-r--r--Lib/json/decoder.py14
-rw-r--r--Lib/json/encoder.py29
-rw-r--r--Lib/json/tool.py3
-rw-r--r--Lib/lib2to3/btm_utils.py6
-rw-r--r--Lib/lib2to3/fixer_util.py23
-rw-r--r--Lib/lib2to3/fixes/fix_intern.py21
-rw-r--r--Lib/lib2to3/fixes/fix_reload.py28
-rw-r--r--Lib/lib2to3/pytree.py9
-rw-r--r--Lib/lib2to3/tests/test_fixers.py59
-rw-r--r--Lib/logging/__init__.py31
-rw-r--r--Lib/logging/config.py72
-rw-r--r--Lib/logging/handlers.py48
-rw-r--r--Lib/lzma.py130
-rw-r--r--Lib/mailbox.py12
-rw-r--r--Lib/mimetypes.py6
-rw-r--r--Lib/multiprocessing/__init__.py7
-rw-r--r--Lib/multiprocessing/forking.py22
-rw-r--r--Lib/multiprocessing/queues.py4
-rw-r--r--Lib/ntpath.py6
-rw-r--r--Lib/os.py32
-rw-r--r--Lib/os2emxpath.py158
-rw-r--r--Lib/pkgutil.py6
-rw-r--r--Lib/plat-os2emx/IN.py82
-rw-r--r--Lib/plat-os2emx/SOCKET.py106
-rw-r--r--Lib/plat-os2emx/_emx_link.py79
-rw-r--r--Lib/plat-os2emx/grp.py182
-rw-r--r--Lib/plat-os2emx/pwd.py208
-rwxr-xr-xLib/plat-os2emx/regen7
-rwxr-xr-xLib/platform.py10
-rw-r--r--Lib/poplib.py91
-rw-r--r--Lib/pty.py1
-rwxr-xr-xLib/pydoc.py2
-rw-r--r--Lib/random.py7
-rw-r--r--Lib/shelve.py9
-rw-r--r--Lib/shutil.py18
-rw-r--r--Lib/site.py23
-rw-r--r--Lib/smtplib.py8
-rw-r--r--Lib/subprocess.py28
-rw-r--r--Lib/sysconfig.py22
-rw-r--r--Lib/tarfile.py11
-rw-r--r--Lib/telnetlib.py4
-rw-r--r--Lib/test/json_tests/test_indent.py4
-rw-r--r--Lib/test/mock_socket.py8
-rwxr-xr-xLib/test/regrtest.py364
-rw-r--r--Lib/test/support.py20
-rw-r--r--Lib/test/test_abc.py13
-rw-r--r--Lib/test/test_argparse.py32
-rw-r--r--Lib/test/test_ast.py13
-rw-r--r--Lib/test/test_builtin.py5
-rw-r--r--Lib/test/test_bytes.py23
-rw-r--r--Lib/test/test_bz2.py136
-rw-r--r--Lib/test/test_cmd_line.py19
-rw-r--r--Lib/test/test_cmd_line_script.py9
-rw-r--r--Lib/test/test_complex.py2
-rw-r--r--Lib/test/test_concurrent_futures.py22
-rw-r--r--Lib/test/test_devpoll.py2
-rw-r--r--Lib/test/test_doctest.py47
-rw-r--r--Lib/test/test_enumerate.py10
-rw-r--r--Lib/test/test_epoll.py7
-rw-r--r--Lib/test/test_exceptions.py17
-rw-r--r--Lib/test/test_fcntl.py15
-rw-r--r--Lib/test/test_fileio.py2
-rw-r--r--Lib/test/test_format.py16
-rw-r--r--Lib/test/test_fractions.py32
-rw-r--r--Lib/test/test_functools.py208
-rw-r--r--Lib/test/test_gc.py26
-rw-r--r--Lib/test/test_generators.py21
-rw-r--r--Lib/test/test_genericpath.py24
-rw-r--r--Lib/test/test_hashlib.py127
-rw-r--r--Lib/test/test_httpservers.py11
-rw-r--r--Lib/test/test_imp.py14
-rw-r--r--Lib/test/test_importlib/import_/test_fromlist.py2
-rw-r--r--Lib/test/test_importlib/source/test_abc_loader.py518
-rw-r--r--Lib/test/test_importlib/test_abc.py18
-rw-r--r--Lib/test/test_io.py10
-rw-r--r--Lib/test/test_iterlen.py62
-rw-r--r--Lib/test/test_itertools.py5
-rw-r--r--Lib/test/test_logging.py165
-rw-r--r--Lib/test/test_mailbox.py2
-rw-r--r--Lib/test/test_mimetypes.py2
-rw-r--r--Lib/test/test_mmap.py4
-rw-r--r--Lib/test/test_multiprocessing.py172
-rw-r--r--Lib/test/test_openpty.py2
-rw-r--r--Lib/test/test_operator.py25
-rw-r--r--Lib/test/test_os.py98
-rw-r--r--Lib/test/test_pep277.py4
-rw-r--r--Lib/test/test_poll.py21
-rw-r--r--Lib/test/test_poplib.py157
-rw-r--r--Lib/test/test_random.py33
-rw-r--r--Lib/test/test_range.py2
-rw-r--r--Lib/test/test_select.py4
-rw-r--r--Lib/test/test_set.py2
-rw-r--r--Lib/test/test_shelve.py13
-rw-r--r--Lib/test/test_shutil.py17
-rw-r--r--Lib/test/test_signal.py9
-rw-r--r--Lib/test/test_site.py6
-rw-r--r--Lib/test/test_slice.py114
-rw-r--r--Lib/test/test_smtplib.py10
-rw-r--r--Lib/test/test_socketserver.py16
-rw-r--r--Lib/test/test_subprocess.py18
-rw-r--r--Lib/test/test_sundry.py34
-rw-r--r--Lib/test/test_syntax.py4
-rw-r--r--Lib/test/test_sys.py34
-rw-r--r--Lib/test/test_sysconfig.py44
-rw-r--r--Lib/test/test_tarfile.py4
-rw-r--r--Lib/test/test_tempfile.py8
-rw-r--r--Lib/test/test_thread.py2
-rw-r--r--Lib/test/test_threading.py6
-rw-r--r--Lib/test/test_threadsignals.py2
-rw-r--r--Lib/test/test_unicode.py30
-rw-r--r--Lib/test/test_unicodedata.py2
-rw-r--r--Lib/test/test_urllib.py92
-rw-r--r--Lib/test/test_urllib2.py44
-rw-r--r--Lib/test/test_urllib2net.py2
-rw-r--r--Lib/test/test_venv.py59
-rw-r--r--Lib/test/test_wait3.py12
-rw-r--r--Lib/test/test_weakref.py140
-rw-r--r--Lib/test/test_winreg.py12
-rw-r--r--Lib/tkinter/__init__.py39
-rw-r--r--Lib/tkinter/filedialog.py4
-rw-r--r--Lib/traceback.py3
-rw-r--r--Lib/unittest/loader.py3
-rw-r--r--Lib/urllib/error.py8
-rw-r--r--Lib/urllib/request.py75
-rw-r--r--Lib/venv/__init__.py23
-rw-r--r--Lib/venv/scripts/posix/activate.csh37
-rw-r--r--Lib/venv/scripts/posix/activate.fish74
-rw-r--r--Lib/weakref.py59
-rw-r--r--Lib/webbrowser.py11
-rw-r--r--Lib/xml/etree/ElementPath.py6
-rw-r--r--Lib/xml/etree/ElementTree.py6
-rw-r--r--Lib/zipfile.py1
-rw-r--r--Mac/Tools/bundlebuilder.py2
-rw-r--r--Makefile.pre.in1
-rw-r--r--Misc/ACKS11
-rw-r--r--Misc/HISTORY4101
-rw-r--r--Misc/NEWS243
-rw-r--r--Misc/RPM/python-3.4.spec (renamed from Misc/RPM/python-3.3.spec)7
-rw-r--r--Misc/TextMate/Python-Dev.tmbundle/Commands/2 to 3 - Module Deletion.tmCommand64
-rw-r--r--Misc/TextMate/Python-Dev.tmbundle/Commands/Build Docs.tmCommand23
-rw-r--r--Misc/TextMate/Python-Dev.tmbundle/Commands/Build.tmCommand25
-rw-r--r--Misc/TextMate/Python-Dev.tmbundle/Commands/Go to Issue.tmCommand20
-rw-r--r--Misc/TextMate/Python-Dev.tmbundle/Commands/Open Docs.tmCommand32
-rw-r--r--Misc/TextMate/Python-Dev.tmbundle/Commands/Open PEP.tmCommand23
-rw-r--r--Misc/TextMate/Python-Dev.tmbundle/Snippets/2 to 3 - Module Deletion (docs).tmSnippet16
-rw-r--r--Misc/TextMate/Python-Dev.tmbundle/info.plist37
-rw-r--r--Misc/Vim/python.vim148
-rw-r--r--Misc/Vim/syntax_test.py62
-rw-r--r--Misc/Vim/vim_syntax.py229
-rw-r--r--Misc/Vim/vimrc87
-rw-r--r--Modules/_dbmmodule.c4
-rw-r--r--Modules/_hashopenssl.c22
-rw-r--r--Modules/_io/bufferedio.c5
-rw-r--r--Modules/_io/fileio.c7
-rw-r--r--Modules/_io/textio.c18
-rw-r--r--Modules/_json.c66
-rw-r--r--Modules/_lsprof.c4
-rw-r--r--Modules/_multiprocessing/multiprocessing.c21
-rw-r--r--Modules/_multiprocessing/multiprocessing.h6
-rw-r--r--Modules/_multiprocessing/semaphore.c14
-rw-r--r--Modules/_posixsubprocess.c2
-rwxr-xr-xModules/_sha3/cleanup.py49
-rw-r--r--Modules/_sha3/keccak/KeccakF-1600-32-rvk.macros555
-rw-r--r--Modules/_sha3/keccak/KeccakF-1600-32-s1.macros1187
-rw-r--r--Modules/_sha3/keccak/KeccakF-1600-32-s2.macros1187
-rw-r--r--Modules/_sha3/keccak/KeccakF-1600-32.macros26
-rw-r--r--Modules/_sha3/keccak/KeccakF-1600-64.macros728
-rw-r--r--Modules/_sha3/keccak/KeccakF-1600-int-set.h6
-rw-r--r--Modules/_sha3/keccak/KeccakF-1600-interface.h46
-rw-r--r--Modules/_sha3/keccak/KeccakF-1600-opt32-settings.h6
-rw-r--r--Modules/_sha3/keccak/KeccakF-1600-opt32.c524
-rw-r--r--Modules/_sha3/keccak/KeccakF-1600-opt64-settings.h9
-rw-r--r--Modules/_sha3/keccak/KeccakF-1600-opt64.c510
-rw-r--r--Modules/_sha3/keccak/KeccakF-1600-simd128.macros651
-rw-r--r--Modules/_sha3/keccak/KeccakF-1600-simd64.macros517
-rw-r--r--Modules/_sha3/keccak/KeccakF-1600-unrolling.macros124
-rw-r--r--Modules/_sha3/keccak/KeccakF-1600-xop.macros573
-rw-r--r--Modules/_sha3/keccak/KeccakNISTInterface.c83
-rw-r--r--Modules/_sha3/keccak/KeccakNISTInterface.h72
-rw-r--r--Modules/_sha3/keccak/KeccakSponge.c266
-rw-r--r--Modules/_sha3/keccak/KeccakSponge.h76
-rwxr-xr-xModules/_sha3/keccak/brg_endian.h142
-rw-r--r--Modules/_sha3/keccak/crypto_hash.h0
-rw-r--r--Modules/_sha3/sha3module.c583
-rw-r--r--Modules/_sre.c14
-rw-r--r--Modules/_struct.c21
-rw-r--r--Modules/_testimportmultiple.c57
-rw-r--r--Modules/_tkinter.c653
-rw-r--r--Modules/arraymodule.c7
-rw-r--r--Modules/cjkcodecs/cjkcodecs.h11
-rw-r--r--Modules/faulthandler.c9
-rw-r--r--Modules/fcntlmodule.c6
-rw-r--r--Modules/gcmodule.c64
-rw-r--r--Modules/getpath.c4
-rw-r--r--Modules/hashlib.h33
-rw-r--r--Modules/main.c6
-rw-r--r--Modules/md5module.c2
-rw-r--r--Modules/operator.c27
-rw-r--r--Modules/posixmodule.c868
-rw-r--r--Modules/pwdmodule.c4
-rw-r--r--Modules/readline.c4
-rw-r--r--Modules/selectmodule.c27
-rw-r--r--Modules/sha1module.c2
-rw-r--r--Modules/sha256module.c22
-rw-r--r--Modules/sha512module.c22
-rw-r--r--Modules/signalmodule.c5
-rw-r--r--Modules/socketmodule.c104
-rw-r--r--Modules/socketmodule.h2
-rw-r--r--Modules/timemodule.c55
-rw-r--r--Modules/unicodedata_db.h616
-rw-r--r--Modules/unicodename_db.h22399
-rw-r--r--Modules/zlibmodule.c4
-rw-r--r--Objects/abstract.c77
-rw-r--r--Objects/bytearrayobject.c74
-rw-r--r--Objects/bytesobject.c111
-rw-r--r--Objects/complexobject.c12
-rw-r--r--Objects/dictobject.c7
-rw-r--r--Objects/frameobject.c8
-rw-r--r--Objects/iterobject.c11
-rw-r--r--Objects/listobject.c2
-rw-r--r--Objects/longobject.c15
-rw-r--r--Objects/object.c20
-rw-r--r--Objects/obmalloc.c28
-rw-r--r--Objects/rangeobject.c205
-rw-r--r--Objects/sliceobject.c191
-rw-r--r--Objects/stringlib/codecs.h6
-rw-r--r--Objects/stringlib/join.h133
-rw-r--r--Objects/typeobject.c2
-rw-r--r--Objects/unicodeobject.c3014
-rw-r--r--Objects/unicodetype_db.h13
-rw-r--r--PC/VC6/pythoncore.dsp4
-rw-r--r--PC/VC6/readme.txt4
-rw-r--r--PC/VS7.1/pythoncore.vcproj24
-rw-r--r--PC/VS7.1/readme.txt4
-rw-r--r--PC/VS8.0/build_ssl.bat4
-rw-r--r--PC/VS8.0/kill_python.c2
-rw-r--r--PC/VS8.0/pyproject.vsprops2
-rw-r--r--PC/VS9.0/_sha3.vcproj513
-rw-r--r--PC/VS9.0/_testimportmultiple.vcproj521
-rw-r--r--PC/VS9.0/kill_python.c2
-rw-r--r--PC/VS9.0/pcbuild.sln39
-rw-r--r--PC/VS9.0/pyproject.vsprops2
-rw-r--r--PC/example_nt/example.vcproj4
-rw-r--r--PC/getpathp.c2
-rw-r--r--PC/os2emx/Makefile672
-rw-r--r--PC/os2emx/README.os2emx663
-rw-r--r--PC/os2emx/config.c164
-rw-r--r--PC/os2emx/dlfcn.c223
-rw-r--r--PC/os2emx/dlfcn.h51
-rw-r--r--PC/os2emx/dllentry.c42
-rw-r--r--PC/os2emx/getpathp.c418
-rw-r--r--PC/os2emx/pyconfig.h332
-rw-r--r--PC/os2emx/python33.def1314
-rw-r--r--PC/os2emx/pythonpm.c124
-rw-r--r--PC/os2vacpp/_tkinter.def8
-rw-r--r--PC/os2vacpp/config.c99
-rw-r--r--PC/os2vacpp/getpathp.c482
-rw-r--r--PC/os2vacpp/makefile1549
-rw-r--r--PC/os2vacpp/makefile.omk1047
-rw-r--r--PC/os2vacpp/pyconfig.h212
-rw-r--r--PC/os2vacpp/python.def479
-rw-r--r--PC/os2vacpp/readme.txt119
-rw-r--r--PC/pyconfig.h4
-rw-r--r--PC/python.mk5
-rw-r--r--PC/python3.def1394
-rw-r--r--PC/python3.mak10
-rw-r--r--PC/python34gen.py (renamed from PC/python33gen.py)8
-rw-r--r--PC/python34stub.def (renamed from PC/python33stub.def)2
-rw-r--r--PC/readme.txt13
-rw-r--r--PCbuild/_sha3.vcxproj218
-rw-r--r--PCbuild/_testimportmultiple.vcxproj218
-rw-r--r--PCbuild/_testimportmultiple.vcxproj.filters13
-rw-r--r--PCbuild/build_ssl.bat4
-rw-r--r--PCbuild/kill_python.c2
-rw-r--r--PCbuild/pcbuild.sln36
-rw-r--r--PCbuild/pyproject.props2
-rw-r--r--PCbuild/readme.txt2
-rw-r--r--Parser/Python.asdl4
-rw-r--r--Parser/asdl.py2
-rwxr-xr-xParser/asdl_c.py12
-rw-r--r--Parser/grammar1.c2
-rw-r--r--Parser/tokenizer.c2
-rw-r--r--Python/Python-ast.c73
-rw-r--r--Python/ast.c22
-rw-r--r--Python/bltinmodule.c8
-rw-r--r--Python/ceval.c2109
-rw-r--r--Python/codecs.c4
-rw-r--r--Python/compile.c25
-rw-r--r--Python/dynload_os2.c42
-rw-r--r--Python/dynload_shlib.c36
-rw-r--r--Python/errors.c15
-rw-r--r--Python/fileutils.c244
-rw-r--r--Python/formatter_unicode.c3
-rw-r--r--Python/import.c38
-rw-r--r--Python/importdl.h5
-rw-r--r--Python/importlib.h7464
-rw-r--r--Python/peephole.c46
-rw-r--r--Python/pythonrun.c7
-rw-r--r--Python/symtable.c58
-rw-r--r--Python/sysmodule.c48
-rw-r--r--Python/thread.c4
-rw-r--r--Python/thread_os2.h267
-rw-r--r--README16
-rwxr-xr-xTools/freeze/freeze.py2
-rw-r--r--Tools/importbench/importbench.py31
-rw-r--r--Tools/msi/msi.py4
-rw-r--r--Tools/parser/unparse.py3
-rw-r--r--Tools/scripts/parse_html5_entities.py105
-rwxr-xr-xTools/stringbench/stringbench.py2
-rw-r--r--Tools/unicode/makeunicodedata.py2
-rwxr-xr-xconfigure20
-rw-r--r--configure.ac2
-rw-r--r--setup.py13
418 files changed, 37702 insertions, 33451 deletions
diff --git a/Doc/c-api/object.rst b/Doc/c-api/object.rst
index a47183c..02a0d36 100644
--- a/Doc/c-api/object.rst
+++ b/Doc/c-api/object.rst
@@ -342,6 +342,15 @@ is considered sufficient for this determination.
returned. This is the equivalent to the Python expression ``len(o)``.
+.. c:function:: Py_ssize_t PyObject_LengthHint(PyObject *o, Py_ssize_t default)
+
+ Return an estimated length for the object *o*. First trying to return its
+ actual length, then an estimate using ``__length_hint__``, and finally
+ returning the default value. On error ``-1`` is returned. This is the
+ equivalent to the Python expression ``operator.length_hint(o, default)``.
+
+ .. versionadded:: 3.4
+
.. c:function:: PyObject* PyObject_GetItem(PyObject *o, PyObject *key)
Return element of *o* corresponding to the object *key* or *NULL* on failure.
diff --git a/Doc/howto/logging-cookbook.rst b/Doc/howto/logging-cookbook.rst
index 92af0ec..b336a4a 100644
--- a/Doc/howto/logging-cookbook.rst
+++ b/Doc/howto/logging-cookbook.rst
@@ -741,9 +741,7 @@ the basis for code meeting your own specific requirements::
break
logger = logging.getLogger(record.name)
logger.handle(record) # No level or filter logic applied - just do it!
- except (KeyboardInterrupt, SystemExit):
- raise
- except:
+ except Exception:
import sys, traceback
print('Whoops! Problem:', file=sys.stderr)
traceback.print_exc(file=sys.stderr)
diff --git a/Doc/library/2to3.rst b/Doc/library/2to3.rst
index d07aaa1..b324aa6 100644
--- a/Doc/library/2to3.rst
+++ b/Doc/library/2to3.rst
@@ -343,6 +343,10 @@ and off individually. They are described here in more detail.
Handles the move of :func:`reduce` to :func:`functools.reduce`.
+.. 2to3fixer:: reload
+
+ Converts :func:`reload` to :func:`imp.reload`.
+
.. 2to3fixer:: renames
Changes :data:`sys.maxint` to :data:`sys.maxsize`.
diff --git a/Doc/library/abc.rst b/Doc/library/abc.rst
index 6f23596..27abb60 100644
--- a/Doc/library/abc.rst
+++ b/Doc/library/abc.rst
@@ -12,9 +12,9 @@
--------------
This module provides the infrastructure for defining :term:`abstract base
-classes <abstract base class>` (ABCs) in Python, as outlined in :pep:`3119`; see the PEP for why this
-was added to Python. (See also :pep:`3141` and the :mod:`numbers` module
-regarding a type hierarchy for numbers based on ABCs.)
+classes <abstract base class>` (ABCs) in Python, as outlined in :pep:`3119`;
+see the PEP for why this was added to Python. (See also :pep:`3141` and the
+:mod:`numbers` module regarding a type hierarchy for numbers based on ABCs.)
The :mod:`collections` module has some concrete classes that derive from
ABCs; these can, of course, be further derived. In addition the
@@ -23,7 +23,7 @@ a class or instance provides a particular interface, for example, is it
hashable or a mapping.
-This module provides the following class:
+This module provides the following classes:
.. class:: ABCMeta
@@ -127,6 +127,19 @@ This module provides the following class:
available as a method of ``Foo``, so it is provided separately.
+.. class:: ABC
+
+ A helper class that has :class:`ABCMeta` as its metaclass. With this class,
+ an abstract base class can be created by simply deriving from :class:`ABC`,
+ avoiding sometimes confusing metaclass usage.
+
+ Note that the type of :class:`ABC` is still :class:`ABCMeta`, therefore
+ inheriting from :class:`ABC` requires the usual precautions regarding metaclass
+ usage, as multiple inheritance may lead to metaclass conflicts.
+
+ .. versionadded:: 3.4
+
+
The :mod:`abc` module also provides the following decorators:
.. decorator:: abstractmethod
diff --git a/Doc/library/argparse.rst b/Doc/library/argparse.rst
index 9f6a1ea..584f4f7 100644
--- a/Doc/library/argparse.rst
+++ b/Doc/library/argparse.rst
@@ -976,9 +976,9 @@ See the section on the default_ keyword argument for information on when the
``type`` argument is applied to default arguments.
To ease the use of various types of files, the argparse module provides the
-factory FileType which takes the ``mode=`` and ``bufsize=`` arguments of the
-:func:`open` function. For example, ``FileType('w')`` can be used to create a
-writable file::
+factory FileType which takes the ``mode=``, ``bufsize=``, ``encoding=`` and
+``errors=`` arguments of the :func:`open` function. For example,
+``FileType('w')`` can be used to create a writable file::
>>> parser = argparse.ArgumentParser()
>>> parser.add_argument('bar', type=argparse.FileType('w'))
@@ -1617,17 +1617,19 @@ Sub-commands
FileType objects
^^^^^^^^^^^^^^^^
-.. class:: FileType(mode='r', bufsize=None)
+.. class:: FileType(mode='r', bufsize=-1, encoding=None, errors=None)
The :class:`FileType` factory creates objects that can be passed to the type
argument of :meth:`ArgumentParser.add_argument`. Arguments that have
- :class:`FileType` objects as their type will open command-line arguments as files
- with the requested modes and buffer sizes::
+ :class:`FileType` objects as their type will open command-line arguments as
+ files with the requested modes, buffer sizes, encodings and error handling
+ (see the :func:`open` function for more details)::
>>> parser = argparse.ArgumentParser()
- >>> parser.add_argument('--output', type=argparse.FileType('wb', 0))
- >>> parser.parse_args(['--output', 'out'])
- Namespace(output=<_io.BufferedWriter name='out'>)
+ >>> parser.add_argument('--raw', type=argparse.FileType('wb', 0))
+ >>> parser.add_argument('out', type=argparse.FileType('w', encoding='UTF-8'))
+ >>> parser.parse_args(['--raw', 'raw.dat', 'file.txt'])
+ Namespace(out=<_io.TextIOWrapper name='file.txt' mode='w' encoding='UTF-8'>, raw=<_io.FileIO name='raw.dat' mode='wb'>)
FileType objects understand the pseudo-argument ``'-'`` and automatically
convert this into ``sys.stdin`` for readable :class:`FileType` objects and
diff --git a/Doc/library/doctest.rst b/Doc/library/doctest.rst
index 222c719..200de45 100644
--- a/Doc/library/doctest.rst
+++ b/Doc/library/doctest.rst
@@ -633,6 +633,16 @@ The second group of options controls how test failures are reported:
the output is suppressed.
+.. data:: FAIL_FAST
+
+ When specified, exit after the first failing example and don't attempt to run
+ the remaining examples. Thus, the number of failures reported will be at most
+ 1. This flag may be useful during debugging, since examples after the first
+ failure won't even produce debugging output.
+
+ .. versionadded:: 3.4
+
+
.. data:: REPORTING_FLAGS
A bitmask or'ing together all the reporting flags above.
diff --git a/Doc/library/exceptions.rst b/Doc/library/exceptions.rst
index 9595221..ece035d 100644
--- a/Doc/library/exceptions.rst
+++ b/Doc/library/exceptions.rst
@@ -260,6 +260,12 @@ The following exceptions are the exceptions that are usually raised.
:exc:`VMSError`, :exc:`socket.error`, :exc:`select.error` and
:exc:`mmap.error` have been merged into :exc:`OSError`.
+ .. versionchanged:: 3.4
+
+ The :attr:`filename` attribute is now the original file name passed to
+ the function, instead of the name encoded to or decoded from the
+ filesystem encoding.
+
.. exception:: OverflowError
diff --git a/Doc/library/gc.rst b/Doc/library/gc.rst
index 41bda1e..95df2f8 100644
--- a/Doc/library/gc.rst
+++ b/Doc/library/gc.rst
@@ -67,6 +67,24 @@ The :mod:`gc` module provides the following functions:
returned.
+.. function:: get_stats()
+
+ Return a list of 3 per-generation dictionaries containing collection
+ statistics since interpreter start. At this moment, each dictionary will
+ contain the following items:
+
+ * ``collections`` is the number of times this generation was collected;
+
+ * ``collected`` is the total number of objects collected inside this
+ generation;
+
+ * ``uncollectable`` is the total number of objects which were found
+ to be uncollectable (and were therefore moved to the :data:`garbage`
+ list) inside this generation.
+
+ .. versionadded:: 3.4
+
+
.. function:: set_threshold(threshold0[, threshold1[, threshold2]])
Set the garbage collection thresholds (the collection frequency). Setting
diff --git a/Doc/library/hashlib.rst b/Doc/library/hashlib.rst
index bc8ab2c..4f5aac9 100644
--- a/Doc/library/hashlib.rst
+++ b/Doc/library/hashlib.rst
@@ -51,9 +51,13 @@ concatenation of the data fed to it so far using the :meth:`digest` or
.. index:: single: OpenSSL; (use in module hashlib)
Constructors for hash algorithms that are always present in this module are
-:func:`md5`, :func:`sha1`, :func:`sha224`, :func:`sha256`, :func:`sha384`, and
-:func:`sha512`. Additional algorithms may also be available depending upon the
-OpenSSL library that Python uses on your platform.
+:func:`md5`, :func:`sha1`, :func:`sha224`, :func:`sha256`, :func:`sha384`,
+:func:`sha512`, :func:`sha3_224`, :func:`sha3_256`, :func:`sha3_384`, and
+:func:`sha3_512`. Additional algorithms may also be available depending upon
+the OpenSSL library that Python uses on your platform.
+
+ .. versionchanged:: 3.4
+ Add sha3 family of hash algorithms.
For example, to obtain the digest of the byte string ``b'Nobody inspects the
spammish repetition'``::
diff --git a/Doc/library/http.server.rst b/Doc/library/http.server.rst
index cbad3ed..0577d5e 100644
--- a/Doc/library/http.server.rst
+++ b/Doc/library/http.server.rst
@@ -177,6 +177,9 @@ of which this module provides three different variants:
complete set of headers is sent, followed by text composed using the
:attr:`error_message_format` class variable.
+ .. versionchanged:: 3.4
+ The error response includes a Content-Length header.
+
.. method:: send_response(code, message=None)
Adds a response header to the headers buffer and logs the accepted
diff --git a/Doc/library/importlib.rst b/Doc/library/importlib.rst
index 083656e..ee9045b 100644
--- a/Doc/library/importlib.rst
+++ b/Doc/library/importlib.rst
@@ -132,8 +132,6 @@ ABC hierarchy::
+-- ExecutionLoader --+
+-- FileLoader
+-- SourceLoader
- +-- PyLoader (deprecated)
- +-- PyPycLoader (deprecated)
.. class:: Finder
@@ -366,10 +364,12 @@ ABC hierarchy::
* :meth:`ResourceLoader.get_data`
* :meth:`ExecutionLoader.get_filename`
Should only return the path to the source file; sourceless
- loading is not supported.
+ loading is not supported (see :class:`SourcelessLoader` if that
+ functionality is required)
The abstract methods defined by this class are to add optional bytecode
- file support. Not implementing these optional methods causes the loader to
+ file support. Not implementing these optional methods (or causing them to
+ raise :exc:`NotImplementedError`) causes the loader to
only work with source code. Implementing the methods allows the loader to
work with source *and* bytecode files; it does not allow for *sourceless*
loading where only bytecode is provided. Bytecode files are an
@@ -409,6 +409,17 @@ ABC hierarchy::
When writing to the path fails because the path is read-only
(:attr:`errno.EACCES`), do not propagate the exception.
+ .. method:: source_to_code(data, path)
+
+ Create a code object from Python source.
+
+ The *data* argument can be whatever the :func:`compile` function
+ supports (i.e. string or bytes). The *path* argument should be
+ the "path" to where the source code originated from, which can be an
+ abstract concept (e.g. location in a zip file).
+
+ .. versionadded:: 3.4
+
.. method:: get_code(fullname)
Concrete implementation of :meth:`InspectLoader.get_code`.
@@ -430,142 +441,6 @@ ABC hierarchy::
itself does not end in ``__init__``.
-.. class:: PyLoader
-
- An abstract base class inheriting from
- :class:`ExecutionLoader` and
- :class:`ResourceLoader` designed to ease the loading of
- Python source modules (bytecode is not handled; see
- :class:`SourceLoader` for a source/bytecode ABC). A subclass
- implementing this ABC will only need to worry about exposing how the source
- code is stored; all other details for loading Python source code will be
- handled by the concrete implementations of key methods.
-
- .. deprecated:: 3.2
- This class has been deprecated in favor of :class:`SourceLoader` and is
- slated for removal in Python 3.4. See below for how to create a
- subclass that is compatible with Python 3.1 onwards.
-
- If compatibility with Python 3.1 is required, then use the following idiom
- to implement a subclass that will work with Python 3.1 onwards (make sure
- to implement :meth:`ExecutionLoader.get_filename`)::
-
- try:
- from importlib.abc import SourceLoader
- except ImportError:
- from importlib.abc import PyLoader as SourceLoader
-
-
- class CustomLoader(SourceLoader):
- def get_filename(self, fullname):
- """Return the path to the source file."""
- # Implement ...
-
- def source_path(self, fullname):
- """Implement source_path in terms of get_filename."""
- try:
- return self.get_filename(fullname)
- except ImportError:
- return None
-
- def is_package(self, fullname):
- """Implement is_package by looking for an __init__ file
- name as returned by get_filename."""
- filename = os.path.basename(self.get_filename(fullname))
- return os.path.splitext(filename)[0] == '__init__'
-
-
- .. method:: source_path(fullname)
-
- An abstract method that returns the path to the source code for a
- module. Should return ``None`` if there is no source code.
- Raises :exc:`ImportError` if the loader knows it cannot handle the
- module.
-
- .. method:: get_filename(fullname)
-
- A concrete implementation of
- :meth:`importlib.abc.ExecutionLoader.get_filename` that
- relies on :meth:`source_path`. If :meth:`source_path` returns
- ``None``, then :exc:`ImportError` is raised.
-
- .. method:: load_module(fullname)
-
- A concrete implementation of :meth:`importlib.abc.Loader.load_module`
- that loads Python source code. All needed information comes from the
- abstract methods required by this ABC. The only pertinent assumption
- made by this method is that when loading a package
- :attr:`__path__` is set to ``[os.path.dirname(__file__)]``.
-
- .. method:: get_code(fullname)
-
- A concrete implementation of
- :meth:`importlib.abc.InspectLoader.get_code` that creates code objects
- from Python source code, by requesting the source code (using
- :meth:`source_path` and :meth:`get_data`) and compiling it with the
- built-in :func:`compile` function.
-
- .. method:: get_source(fullname)
-
- A concrete implementation of
- :meth:`importlib.abc.InspectLoader.get_source`. Uses
- :meth:`importlib.abc.ResourceLoader.get_data` and :meth:`source_path`
- to get the source code. It tries to guess the source encoding using
- :func:`tokenize.detect_encoding`.
-
-
-.. class:: PyPycLoader
-
- An abstract base class inheriting from :class:`PyLoader`.
- This ABC is meant to help in creating loaders that support both Python
- source and bytecode.
-
- .. deprecated:: 3.2
- This class has been deprecated in favor of :class:`SourceLoader` and to
- properly support :pep:`3147`. If compatibility is required with
- Python 3.1, implement both :class:`SourceLoader` and :class:`PyLoader`;
- instructions on how to do so are included in the documentation for
- :class:`PyLoader`. Do note that this solution will not support
- sourceless/bytecode-only loading; only source *and* bytecode loading.
-
- .. versionchanged:: 3.3
- Updated to parse (but not use) the new source size field in bytecode
- files when reading and to write out the field properly when writing.
-
- .. method:: source_mtime(fullname)
-
- An abstract method which returns the modification time for the source
- code of the specified module. The modification time should be an
- integer. If there is no source code, return ``None``. If the
- module cannot be found then :exc:`ImportError` is raised.
-
- .. method:: bytecode_path(fullname)
-
- An abstract method which returns the path to the bytecode for the
- specified module, if it exists. It returns ``None``
- if no bytecode exists (yet).
- Raises :exc:`ImportError` if the loader knows it cannot handle the
- module.
-
- .. method:: get_filename(fullname)
-
- A concrete implementation of
- :meth:`ExecutionLoader.get_filename` that relies on
- :meth:`PyLoader.source_path` and :meth:`bytecode_path`.
- If :meth:`source_path` returns a path, then that value is returned.
- Else if :meth:`bytecode_path` returns a path, that path will be
- returned. If a path is not available from both methods,
- :exc:`ImportError` is raised.
-
- .. method:: write_bytecode(fullname, bytecode)
-
- An abstract method which has the loader write *bytecode* for future
- use. If the bytecode is written, return ``True``. Return
- ``False`` if the bytecode could not be written. This method
- should not be called if :data:`sys.dont_write_bytecode` is true.
- The *bytecode* argument should be a bytes string or bytes array.
-
-
:mod:`importlib.machinery` -- Importers and path hooks
------------------------------------------------------
diff --git a/Doc/library/json.rst b/Doc/library/json.rst
index bdb6436..25a3358 100644
--- a/Doc/library/json.rst
+++ b/Doc/library/json.rst
@@ -42,8 +42,7 @@ Compact encoding::
Pretty printing::
>>> import json
- >>> print(json.dumps({'4': 5, '6': 7}, sort_keys=True,
- ... indent=4, separators=(',', ': ')))
+ >>> print(json.dumps({'4': 5, '6': 7}, sort_keys=True, indent=4))
{
"4": 5,
"6": 7
@@ -156,15 +155,13 @@ Basic Usage
.. versionchanged:: 3.2
Allow strings for *indent* in addition to integers.
- .. note::
-
- Since the default item separator is ``', '``, the output might include
- trailing whitespace when *indent* is specified. You can use
- ``separators=(',', ': ')`` to avoid this.
+ If specified, *separators* should be an ``(item_separator, key_separator)``
+ tuple. The default is ``(', ', ': ')`` if *indent* is ``None`` and
+ ``(',', ': ')`` otherwise. To get the most compact JSON representation,
+ you should specify ``(',', ':')`` to eliminate whitespace.
- If *separators* is an ``(item_separator, dict_separator)`` tuple, then it
- will be used instead of the default ``(', ', ': ')`` separators. ``(',',
- ':')`` is the most compact JSON representation.
+ .. versionchanged:: 3.4
+ Use ``(',', ': ')`` as default if *indent* is not ``None``.
*default(obj)* is a function that should return a serializable version of
*obj* or raise :exc:`TypeError`. The default simply raises :exc:`TypeError`.
@@ -400,15 +397,13 @@ Encoders and Decoders
.. versionchanged:: 3.2
Allow strings for *indent* in addition to integers.
- .. note::
-
- Since the default item separator is ``', '``, the output might include
- trailing whitespace when *indent* is specified. You can use
- ``separators=(',', ': ')`` to avoid this.
-
If specified, *separators* should be an ``(item_separator, key_separator)``
- tuple. The default is ``(', ', ': ')``. To get the most compact JSON
- representation, you should specify ``(',', ':')`` to eliminate whitespace.
+ tuple. The default is ``(', ', ': ')`` if *indent* is ``None`` and
+ ``(',', ': ')`` otherwise. To get the most compact JSON representation,
+ you should specify ``(',', ':')`` to eliminate whitespace.
+
+ .. versionchanged:: 3.4
+ Use ``(',', ': ')`` as default if *indent* is not ``None``.
If specified, *default* is a function that gets called for objects that can't
otherwise be serialized. It should return a JSON encodable version of the
diff --git a/Doc/library/logging.config.rst b/Doc/library/logging.config.rst
index 1391ed2..16d3294 100644
--- a/Doc/library/logging.config.rst
+++ b/Doc/library/logging.config.rst
@@ -76,11 +76,23 @@ in :mod:`logging` itself) and defining handlers which are declared either in
.. function:: fileConfig(fname, defaults=None, disable_existing_loggers=True)
- Reads the logging configuration from a :mod:`configparser`\-format file
- named *fname*. This function can be called several times from an
- application, allowing an end user to select from various pre-canned
- configurations (if the developer provides a mechanism to present the choices
- and load the chosen configuration).
+ Reads the logging configuration from a :mod:`configparser`\-format file.
+ This function can be called several times from an application, allowing an
+ end user to select from various pre-canned configurations (if the developer
+ provides a mechanism to present the choices and load the chosen
+ configuration).
+
+ :param fname: A filename, or a file-like object, or an instance derived
+ from :class:`~configparser.RawConfigParser`. If a
+ ``RawConfigParser``-derived instance is passed, it is used as
+ is. Otherwise, a :class:`~configparser.Configparser` is
+ instantiated, and the configuration read by it from the
+ object passed in ``fname``. If that has a :meth:`readline`
+ method, it is assumed to be a file-like object and read using
+ :meth:`~configparser.ConfigParser.read_file`; otherwise,
+ it is assumed to be a filename and passed to
+ :meth:`~configparser.ConfigParser.read`.
+
:param defaults: Defaults to be passed to the ConfigParser can be specified
in this argument.
@@ -94,8 +106,17 @@ in :mod:`logging` itself) and defining handlers which are declared either in
their ancestors are explicitly named in the
logging configuration.
+ .. versionchanged:: 3.4
+ An instance of a subclass of :class:`~configparser.RawConfigParser` is
+ now accepted as a value for ``fname``. This facilitates:
+
+ * Use of a configuration file where logging configuration is just part
+ of the overall application configuration.
+ * Use of a configuration read from a file, and then modified by the using
+ application (e.g. based on command-line parameters or other aspects
+ of the runtime environment) before being passed to ``fileConfig``.
-.. function:: listen(port=DEFAULT_LOGGING_CONFIG_PORT)
+.. function:: listen(port=DEFAULT_LOGGING_CONFIG_PORT, verify=None)
Starts up a socket server on the specified port, and listens for new
configurations. If no port is specified, the module's default
@@ -105,6 +126,17 @@ in :mod:`logging` itself) and defining handlers which are declared either in
server, and which you can :meth:`join` when appropriate. To stop the server,
call :func:`stopListening`.
+ The ``verify`` argument, if specified, should be a callable which should
+ verify whether bytes received across the socket are valid and should be
+ processed. This could be done by encrypting and/or signing what is sent
+ across the socket, such that the ``verify`` callable can perform
+ signature verification and/or decryption. The ``verify`` callable is called
+ with a single argument - the bytes received across the socket - and should
+ return the bytes to be processed, or None to indicate that the bytes should
+ be discarded. The returned bytes could be the same as the passed in bytes
+ (e.g. when only verification is done), or they could be completely different
+ (perhaps if decryption were performed).
+
To send a configuration to the socket, read in the configuration file and
send it to the socket as a string of bytes preceded by a four-byte length
string packed in binary using ``struct.pack('>L', n)``.
@@ -121,7 +153,12 @@ in :mod:`logging` itself) and defining handlers which are declared either in
:func:`listen` socket and sending a configuration which runs whatever
code the attacker wants to have executed in the victim's process. This is
especially easy to do if the default port is used, but not hard even if a
- different port is used).
+ different port is used). To avoid the risk of this happening, use the
+ ``verify`` argument to :func:`listen` to prevent unrecognised
+ configurations from being applied.
+
+ .. versionchanged:: 3.4.
+ The ``verify`` argument was added.
.. function:: stopListening()
diff --git a/Doc/library/operator.rst b/Doc/library/operator.rst
index 3860880..877a790 100644
--- a/Doc/library/operator.rst
+++ b/Doc/library/operator.rst
@@ -235,6 +235,14 @@ their character equivalents.
.. XXX: find a better, readable, example
+.. function:: length_hint(obj, default=0)
+
+ Return an estimated length for the object *o*. First trying to return its
+ actual length, then an estimate using :meth:`object.__length_hint__`, and
+ finally returning the default value.
+
+ .. versionadded:: 3.4
+
The :mod:`operator` module also defines tools for generalized attribute and item
lookups. These are useful for making fast field extractors as arguments for
:func:`map`, :func:`sorted`, :meth:`itertools.groupby`, or other functions that
diff --git a/Doc/library/os.path.rst b/Doc/library/os.path.rst
index 13bda9b..d9b7138 100644
--- a/Doc/library/os.path.rst
+++ b/Doc/library/os.path.rst
@@ -37,7 +37,6 @@ applications should use string objects to access all files.
* :mod:`posixpath` for UNIX-style paths
* :mod:`ntpath` for Windows paths
* :mod:`macpath` for old-style MacOS paths
- * :mod:`os2emxpath` for OS/2 EMX paths
.. function:: abspath(path)
diff --git a/Doc/library/os.rst b/Doc/library/os.rst
index 027ad70..d2f7d01 100644
--- a/Doc/library/os.rst
+++ b/Doc/library/os.rst
@@ -54,7 +54,7 @@ Notes on the availability of these functions:
The name of the operating system dependent module imported. The following
names have currently been registered: ``'posix'``, ``'nt'``, ``'mac'``,
- ``'os2'``, ``'ce'``, ``'java'``.
+ ``'ce'``, ``'java'``.
.. seealso::
:attr:`sys.platform` has a finer granularity. :func:`os.uname` gives
diff --git a/Doc/library/poplib.rst b/Doc/library/poplib.rst
index 01f680e..1ac93c9 100644
--- a/Doc/library/poplib.rst
+++ b/Doc/library/poplib.rst
@@ -13,8 +13,11 @@
--------------
This module defines a class, :class:`POP3`, which encapsulates a connection to a
-POP3 server and implements the protocol as defined in :rfc:`1725`. The
-:class:`POP3` class supports both the minimal and optional command sets.
+POP3 server and implements the protocol as defined in :rfc:`1939`. The
+:class:`POP3` class supports both the minimal and optional command sets from
+:rfc:`1939`. The :class:`POP3` class also supports the `STLS` command introduced
+in :rfc:`2595` to enable encrypted communication on an already established connection.
+
Additionally, this module provides a class :class:`POP3_SSL`, which provides
support for connecting to POP3 servers that use SSL as an underlying protocol
layer.
@@ -97,6 +100,14 @@ An :class:`POP3` instance has the following methods:
Returns the greeting string sent by the POP3 server.
+.. method:: POP3.capa()
+
+ Query the server's capabilities as specified in :rfc:`2449`.
+ Returns a dictionary in the form ``{'name': ['param'...]}``.
+
+ .. versionadded:: 3.4
+
+
.. method:: POP3.user(username)
Send user command, response should indicate that a password is required.
@@ -176,6 +187,18 @@ An :class:`POP3` instance has the following methods:
the unique id for that message in the form ``'response mesgnum uid``, otherwise
result is list ``(response, ['mesgnum uid', ...], octets)``.
+.. method:: POP3.stls(context=None)
+
+ Start a TLS session on the active connection as specified in :rfc:`2595`.
+ This is only allowed before user authentication
+
+ *context* parameter is a :class:`ssl.SSLContext` object which allows
+ bundling SSL configuration options, certificates and private keys into
+ a single (potentially long-lived) structure.
+
+ .. versionadded:: 3.4
+
+
Instances of :class:`POP3_SSL` have no additional methods. The interface of this
subclass is identical to its parent.
diff --git a/Doc/library/pty.rst b/Doc/library/pty.rst
index 2b9385b..90baec5 100644
--- a/Doc/library/pty.rst
+++ b/Doc/library/pty.rst
@@ -45,6 +45,9 @@ The :mod:`pty` module defines the following functions:
a file descriptor. The defaults try to read 1024 bytes each time they are
called.
+ .. versionchanged:: 3.4
+ :func:`spawn` now returns the status value from :func:`os.waitpid`
+ on the child process.
Example
-------
diff --git a/Doc/library/select.rst b/Doc/library/select.rst
index 4e60f4a..b73f11e 100644
--- a/Doc/library/select.rst
+++ b/Doc/library/select.rst
@@ -47,11 +47,14 @@ The module defines the following:
to :const:`EPOLL_CLOEXEC`, which causes the epoll descriptor to be closed
automatically when :func:`os.execve` is called. See section
:ref:`epoll-objects` below for the methods supported by epolling objects.
-
+ They also support the :keyword:`with` statement.
.. versionchanged:: 3.3
Added the *flags* parameter.
+ .. versionchanged:: 3.4
+ Support for the :keyword:`with` statement was added.
+
.. function:: poll()
diff --git a/Doc/library/shutil.rst b/Doc/library/shutil.rst
index e962112..5d3f881 100644
--- a/Doc/library/shutil.rst
+++ b/Doc/library/shutil.rst
@@ -53,7 +53,7 @@ Directory and files operations
*dst* and return *dst*. *src* and *dst* are path names given as strings.
*dst* must be the complete target file name; look at :func:`shutil.copy`
for a copy that accepts a target directory path. If *src* and *dst*
- specify the same file, :exc:`Error` is raised.
+ specify the same file, :exc:`SameFileError` is raised.
The destination location must be writable; otherwise, an :exc:`OSError`
exception will be raised. If *dst* already exists, it will be replaced.
@@ -69,6 +69,19 @@ Directory and files operations
Added *follow_symlinks* argument.
Now returns *dst*.
+ .. versionchanged:: 3.4
+ Raise :exc:`SameFileError` instead of :exc:`Error`. Since the former is
+ a subclass of the latter, this change is backward compatible.
+
+
+.. exception:: SameFileError
+
+ This exception is raised if source and destination in :func:`copyfile`
+ are the same file.
+
+ .. versionadded:: 3.4
+
+
.. function:: copymode(src, dst, *, follow_symlinks=True)
Copy the permission bits from *src* to *dst*. The file contents, owner, and
diff --git a/Doc/library/sys.rst b/Doc/library/sys.rst
index 93273c4..a906cde 100644
--- a/Doc/library/sys.rst
+++ b/Doc/library/sys.rst
@@ -393,6 +393,21 @@ always available.
.. versionadded:: 3.1
+.. function:: getallocatedblocks()
+
+ Return the number of memory blocks currently allocated by the interpreter,
+ regardless of their size. This function is mainly useful for tracking
+ and debugging memory leaks. Because of the interpreter's internal
+ caches, the result can vary from call to call; you may have to call
+ :func:`_clear_type_cache()` and :func:`gc.collect()` to get more
+ predictable results.
+
+ If a Python build or implementation cannot reasonably compute this
+ information, :func:`getallocatedblocks()` is allowed to return 0 instead.
+
+ .. versionadded:: 3.4
+
+
.. function:: getcheckinterval()
Return the interpreter's "check interval"; see :func:`setcheckinterval`.
@@ -839,8 +854,6 @@ always available.
Windows ``'win32'``
Windows/Cygwin ``'cygwin'``
Mac OS X ``'darwin'``
- OS/2 ``'os2'``
- OS/2 EMX ``'os2emx'``
================ ===========================
.. versionchanged:: 3.3
@@ -1119,7 +1132,6 @@ always available.
| :const:`name` | Name of the thread implementation: |
| | |
| | * ``'nt'``: Windows threads |
- | | * ``'os2'``: OS/2 threads |
| | * ``'pthread'``: POSIX threads |
| | * ``'solaris'``: Solaris threads |
+------------------+---------------------------------------------------------+
diff --git a/Doc/library/sysconfig.rst b/Doc/library/sysconfig.rst
index c47dcce..535ac54 100644
--- a/Doc/library/sysconfig.rst
+++ b/Doc/library/sysconfig.rst
@@ -83,8 +83,6 @@ Python currently supports seven schemes:
located under the user home directory.
- *nt*: scheme for NT platforms like Windows.
- *nt_user*: scheme for NT platforms, when the *user* option is used.
-- *os2*: scheme for OS/2 platforms.
-- *os2_home*: scheme for OS/2 patforms, when the *user* option is used.
Each scheme is itself composed of a series of paths and each path has a unique
identifier. Python currently uses eight paths:
diff --git a/Doc/library/timeit.rst b/Doc/library/timeit.rst
index a487917..0cc1586 100644
--- a/Doc/library/timeit.rst
+++ b/Doc/library/timeit.rst
@@ -151,7 +151,7 @@ The module defines three convenience functions and a public class:
t = Timer(...) # outside the try/except
try:
t.timeit(...) # or t.repeat(...)
- except:
+ except Exception:
t.print_exc()
The advantage over the standard traceback is that source lines in the
diff --git a/Doc/library/tkinter.rst b/Doc/library/tkinter.rst
index 83a5375..377694f 100644
--- a/Doc/library/tkinter.rst
+++ b/Doc/library/tkinter.rst
@@ -750,32 +750,6 @@ Entry widget indexes (index, view index, etc.)
displayed. You can use these :mod:`tkinter` functions to access these special
points in text widgets:
-.. function:: AtEnd()
- refers to the last position in the text
-
- .. deprecated:: 3.3
-
-.. function:: AtInsert()
- refers to the point where the text cursor is
-
- .. deprecated:: 3.3
-
-.. function:: AtSelFirst()
- indicates the beginning point of the selected text
-
- .. deprecated:: 3.3
-
-.. function:: AtSelLast()
- denotes the last point of the selected text and finally
-
- .. deprecated:: 3.3
-
-.. function:: At(x[, y])
- refers to the character at pixel location *x*, *y* (with *y* not used in the
- case of a text entry widget, which contains a single line of text).
-
- .. deprecated:: 3.3
-
Text widget indexes
The index notation for Text widgets is very rich and is best described in the Tk
man pages.
diff --git a/Doc/library/traceback.rst b/Doc/library/traceback.rst
index 32e5733..0533bea 100644
--- a/Doc/library/traceback.rst
+++ b/Doc/library/traceback.rst
@@ -146,7 +146,7 @@ module. ::
source = input(">>> ")
try:
exec(source, envdir)
- except:
+ except Exception:
print("Exception in user code:")
print("-"*60)
traceback.print_exc(file=sys.stdout)
diff --git a/Doc/library/unicodedata.rst b/Doc/library/unicodedata.rst
index ad70dd9..52acc18 100644
--- a/Doc/library/unicodedata.rst
+++ b/Doc/library/unicodedata.rst
@@ -15,8 +15,8 @@
This module provides access to the Unicode Character Database (UCD) which
defines character properties for all Unicode characters. The data contained in
-this database is compiled from the `UCD version 6.1.0
-<http://www.unicode.org/Public/6.1.0/ucd>`_.
+this database is compiled from the `UCD version 6.2.0
+<http://www.unicode.org/Public/6.2.0/ucd>`_.
The module uses the same names and symbols as defined by Unicode
Standard Annex #44, `"Unicode Character Database"
diff --git a/Doc/library/urllib.error.rst b/Doc/library/urllib.error.rst
index 9c3fe91..7bd04b1 100644
--- a/Doc/library/urllib.error.rst
+++ b/Doc/library/urllib.error.rst
@@ -45,6 +45,13 @@ The following exceptions are raised by :mod:`urllib.error` as appropriate:
This is usually a string explaining the reason for this error.
+ .. attribute:: headers
+
+ The HTTP response headers for the HTTP request that cause the
+ :exc:`HTTPError`.
+
+ .. versionadded:: 3.4
+
.. exception:: ContentTooShortError(msg, content)
This exception is raised when the :func:`urlretrieve` function detects that
diff --git a/Doc/library/urllib.request.rst b/Doc/library/urllib.request.rst
index 21255e5..65637fd 100644
--- a/Doc/library/urllib.request.rst
+++ b/Doc/library/urllib.request.rst
@@ -121,7 +121,7 @@ The :mod:`urllib.request` module defines the following functions:
instances of them or subclasses of them: :class:`ProxyHandler`,
:class:`UnknownHandler`, :class:`HTTPHandler`, :class:`HTTPDefaultErrorHandler`,
:class:`HTTPRedirectHandler`, :class:`FTPHandler`, :class:`FileHandler`,
- :class:`HTTPErrorProcessor`.
+ :class:`HTTPErrorProcessor`, :class:`DataHandler`.
If the Python installation has SSL support (i.e., if the :mod:`ssl` module
can be imported), :class:`HTTPSHandler` will also be added.
@@ -346,6 +346,11 @@ The following classes are provided:
Open local files.
+.. class:: DataHandler()
+
+ Open data URLs.
+
+ .. versionadded:: 3.4
.. class:: FTPHandler()
@@ -403,6 +408,10 @@ request.
The entity body for the request, or None if not specified.
+ .. versionchanged:: 3.4
+ Changing value of :attr:`Request.data` now deletes "Content-Length"
+ header if it was previously set or calculated.
+
.. attribute:: Request.unverifiable
boolean, indicates whether the request is unverifiable as defined
@@ -451,6 +460,12 @@ request.
unredirected).
+.. method:: Request.remove_header(header)
+
+ Remove named header from the request instance (both from regular and
+ unredirected headers).
+
+
.. method:: Request.get_full_url()
Return the URL given in the constructor.
@@ -972,6 +987,21 @@ FileHandler Objects
hostname is given, an :exc:`URLError` is raised.
+.. _data-handler-objects:
+
+DataHandler Objects
+-------------------
+
+.. method:: DataHandler.data_open(req)
+
+ Read a data URL. This kind of URL contains the content encoded in the URL
+ itself. The data URL syntax is specified in :rfc:`2397`. This implementation
+ ignores white spaces in base64 encoded data URLs so the URL may be wrapped
+ in whatever source file it comes from. But even though some browsers don't
+ mind about a missing padding at the end of a base64 encoded data URL, this
+ implementation will raise an :exc:`ValueError` in that case.
+
+
.. _ftp-handler-objects:
FTPHandler Objects
@@ -1374,7 +1404,9 @@ some point in the future.
pair: FTP; protocol
* Currently, only the following protocols are supported: HTTP (versions 0.9 and
- 1.0), FTP, and local files.
+ 1.0), FTP, local files, and data URLs.
+
+ .. versionchanged:: 3.4 Added support for data URLs.
* The caching feature of :func:`urlretrieve` has been disabled until someone
finds the time to hack proper processing of Expiration time headers.
diff --git a/Doc/library/venv.rst b/Doc/library/venv.rst
index 2499962..b2ecd93 100644
--- a/Doc/library/venv.rst
+++ b/Doc/library/venv.rst
@@ -75,8 +75,8 @@ creation according to their needs, the :class:`EnvBuilder` class.
* ``system_site_packages`` -- a Boolean value indicating that the system Python
site-packages should be available to the environment (defaults to ``False``).
- * ``clear`` -- a Boolean value which, if True, will delete any existing target
- directory instead of raising an exception (defaults to ``False``).
+ * ``clear`` -- a Boolean value which, if True, will delete the contents of
+ any existing target directory, before creating the environment.
* ``symlinks`` -- a Boolean value indicating whether to attempt to symlink the
Python binary (and any necessary DLLs or other binaries,
@@ -88,7 +88,6 @@ creation according to their needs, the :class:`EnvBuilder` class.
upgraded in-place (defaults to ``False``).
-
Creators of third-party virtual environment tools will be free to use the
provided ``EnvBuilder`` class as a base class.
diff --git a/Doc/library/weakref.rst b/Doc/library/weakref.rst
index 224f442..1bf6b58 100644
--- a/Doc/library/weakref.rst
+++ b/Doc/library/weakref.rst
@@ -192,6 +192,35 @@ These method have the same issues as the and :meth:`keyrefs` method of
discarded when no strong reference to it exists any more.
+.. class:: WeakMethod(method)
+
+ A custom :class:`ref` subclass which simulates a weak reference to a bound
+ method (i.e., a method defined on a class and looked up on an instance).
+ Since a bound method is ephemeral, a standard weak reference cannot keep
+ hold of it. :class:`WeakMethod` has special code to recreate the bound
+ method until either the object or the original function dies::
+
+ >>> class C:
+ ... def method(self):
+ ... print("method called!")
+ ...
+ >>> c = C()
+ >>> r = weakref.ref(c.method)
+ >>> r()
+ >>> r = weakref.WeakMethod(c.method)
+ >>> r()
+ <bound method C.method of <__main__.C object at 0x7fc859830220>>
+ >>> r()()
+ method called!
+ >>> del c
+ >>> gc.collect()
+ 0
+ >>> r()
+ >>>
+
+ .. versionadded:: 3.4
+
+
.. data:: ReferenceType
The type object for weak references objects.
diff --git a/Doc/license.rst b/Doc/license.rst
index 6326ce4..e56ca5b 100644
--- a/Doc/license.rst
+++ b/Doc/license.rst
@@ -122,6 +122,8 @@ been GPL-compatible; the table below summarizes the various releases.
+----------------+--------------+------------+------------+-----------------+
| 3.3.0 | 3.2 | 2012 | PSF | yes |
+----------------+--------------+------------+------------+-----------------+
+| 3.4.0 | 3.3.0 | 2014 | PSF | yes |
++----------------+--------------+------------+------------+-----------------+
.. note::
@@ -656,6 +658,25 @@ The :mod:`select` and contains the following notice for the kqueue interface::
SUCH DAMAGE.
+SHA-3
+-----
+
+The module :mod:`_sha3` and :mod:`hashlib` are using the reference
+implementation of Keccak. The files at :file:`Modules/_sha3/keccak/` contain
+the following note::
+
+ The Keccak sponge function, designed by Guido Bertoni, Joan Daemen,
+ Michaƫl Peeters and Gilles Van Assche. For more information, feedback or
+ questions, please refer to our website: http://keccak.noekeon.org/
+
+ Implementation by the designers,
+ hereby denoted as "the implementer".
+
+ To the extent possible under law, the implementer has waived all copyright
+ and related or neighboring rights to the source code in this file.
+ http://creativecommons.org/publicdomain/zero/1.0/
+
+
strtod and dtoa
---------------
diff --git a/Doc/reference/datamodel.rst b/Doc/reference/datamodel.rst
index 7c51068..9a39eb4 100644
--- a/Doc/reference/datamodel.rst
+++ b/Doc/reference/datamodel.rst
@@ -1815,6 +1815,15 @@ through the container; for mappings, :meth:`__iter__` should be the same as
considered to be false in a Boolean context.
+.. method:: object.__length_hint__(self)
+
+ Called to implement :func:`operator.length_hint`. Should return an estimated
+ length for the object (which may be greater or less than the actual length).
+ The length must be an integer ``>=`` 0. This method is purely an
+ optimization and is never required for correctness.
+
+ .. versionadded:: 3.4
+
.. note::
Slicing is done exclusively with the following three methods. A call like ::
diff --git a/Doc/tools/sphinxext/indexsidebar.html b/Doc/tools/sphinxext/indexsidebar.html