• Home
  • Raw
  • Download

Lines Matching +full:json +full:- +full:schema +full:- +full:traverse

41    sufficient; the e-mail address isn't necessary.
56 floating-point numbers and for the :class:`~decimal.Decimal` class.
59 for parsing command-line options, convenient :class:`~collections.OrderedDict`
77 .. _whatsnew27-python31:
101 Some key consequences of the long-term significance of 2.7 are:
107 release, compared to the more typical support period of 18--24 months).
127 :ref:`py27-maintenance-enhancements` section below.
133 The recommended starting point is the :ref:`pyporting-howto` HOWTO guide.
144 on stdlib-sig and carried out in :issue:`7319`.)
151 However, there are increasingly many users of Python-based
158 You can re-enable display of :exc:`DeprecationWarning` messages by
159 running Python with the :option:`-Wdefault <-W>` (short form:
160 :option:`-Wd <-W>`) switch, or by setting the :envvar:`PYTHONWARNINGS`
162 Python. Python code can also re-enable them
183 * The ordered-dictionary type described in :ref:`pep-0372`.
184 * The new ``","`` format specifier described in :ref:`pep-0378`.
187 `described below <#importlib-section>`__.
192 * Float-to-string and string-to-float conversions are correctly rounded.
197 Other new Python3-mode warnings include:
201 * The :option:`!-3` switch now automatically
202 enables the :option:`!-Qwarn` switch that causes warnings
208 .. Large, PEP-level features and changes should be described here.
211 .. _pep-0372:
284 deletion doesn't have to traverse the entire linked list and therefore
298 * The :mod:`json` module's :class:`~json.JSONDecoder` class
301 Support was also added for third-party tools like
306 :pep:`372` - Adding an ordered dictionary to collections
310 .. _pep-0378:
322 to use and unsuitable for multi-threaded applications where different
325 Therefore, a simple comma-grouping mechanism has been added to the
326 mini-language used by the :meth:`str.format` method. When
327 formatting a floating-point number, simply include a comma between the
339 separator and the grouping is always into three-digit groups. The
340 comma-formatting mechanism isn't as general as the :mod:`locale`
345 :pep:`378` - Format Specifier for Thousands Separator
351 The :mod:`argparse` module for parsing command-line arguments was
356 command-line arguments: :mod:`getopt`, :mod:`optparse`, and
374 parser = argparse.ArgumentParser(description='Command-line example.')
377 parser.add_argument('-v', action='store_true', dest='is_verbose',
379 parser.add_argument('-o', action='store', dest='output',
382 parser.add_argument('-C', action='store', type=int, dest='context',
393 Unless you override it, :option:`!-h` and :option:`!--help` switches
396 -> ./python.exe argparse-example.py --help
397 usage: argparse-example.py [-h] [-v] [-o FILE] [-C NUM] [inputs [inputs ...]]
399 Command-line example.
405 -h, --help show this help message and exit
406 -v produce verbose output
407 -o FILE direct output to FILE instead of stdout
408 -C NUM display NUM lines of added context
410 As with :mod:`optparse`, the command-line switches and arguments
413 -> ./python.exe argparse-example.py -v
419 -> ./python.exe argparse-example.py -v -o /tmp/output -C 4 file1 file2
428 optional argument with ``'?'``. A top-level parser can contain
429 sub-parsers to define subcommands that have different sets of
432 automatically open files for you and understands that ``'-'`` means
440 :ref:`upgrading-optparse-code`
444 :pep:`389` - argparse - New Command Line Parsing Module
447 PEP 391: Dictionary-Based Configuration For Logging
457 but a complex set-up requires verbose but boring code.
465 parse a file containing JSON; or use a YAML parsing library if one is
466 installed. For more information see :ref:`logging-config-api`.
480 'version': 1, # Configuration schema in use; must be 1 for now
483 'format': ('%(asctime)s %(name)-15s '
484 '%(levelname)-8s %(message)s')}},
544 :pep:`391` - Dictionary-Based Configuration For Logging
605 :pep:`3106` - Revamping dict.keys(), .values() and .items()
652 TypeError: cannot modify read-only memory
664 :pep:`3137` - Immutable Bytes and Mutable Buffer
729 * Conversions between floating-point numbers and strings are
737 and :mod:`json` modules;
739 and :class:`~decimal.Decimal`-to-float conversion.
741 Related to this, the :func:`repr` of a floating-point number *x*
744 round-half-to-even rounding mode). Previously it gave a string
761 point now round differently, returning the floating-point number
770 >>> n - long(float(n))
773 Python 2.7's floating-point result is larger, but much closer to the
779 >>> n - long(float(n))
780 -1L
800 The auto-numbering takes the fields from left to right, so the first ``{...}``
802 specifier will use the next argument, and so on. You can't mix auto-numbering
803 and explicit numbering -- either number all of your specifier fields or none
804 of them -- but you can mix auto-numbering and named fields, as in the second
808 and default to being right-aligned.
809 Specifying a precision or comma-separation applies to both the real
818 A low-level change: the :meth:`object.__format__` method now triggers
826 in some object-specific way. (Fixed by Eric Smith; :issue:`7994`.)
837 >>> n = 2**123-1
851 * It's now possible for a subclass of the built-in :class:`unicode` type
880 now explicitly checks for and forbids writing to read-only file objects
885 :func:`compile` built-in function now accepts code using any
886 line-ending convention. Additionally, it no longer requires that the
891 Python3-warning mode, Python 2.7 will now warn about this odd usage.
894 * It's now possible to create weak references to old-style class
895 objects. New-style classes were always weak-referenceable. (Fixed
898 * When a module object is garbage-collected, the module's dictionary is
904 .. _new-27-interpreter:
907 -------------------------------
912 used with the :option:`-W` switch, separated by commas.
928 -------------
959 significant performance improvements on 64-bit machines, but
960 benchmark results on 32-bit machines have been mixed. Therefore,
961 the default is to use base ``2**30`` on 64-bit machines and base ``2**15``
962 on 32-bit machines; on Unix, there's a new configure option
963 :option:`!--enable-big-digits` that can be used to override this default.
979 smaller on 32-bit systems and 6 bytes on 64-bit.
991 * The implementation of ``%`` checks for the left-side operand being
992 a Python string and special-cases it; this results in a 1--3%
998 faster bytecode. (Patch by Antoine Pitrou, back-ported to 2.7
1002 faster by special-casing base 10 instead of using a generalized
1007 :meth:`rpartition`, and :meth:`rsplit` methods of string-like types
1009 fast reverse-search algorithm instead of a character-by-character
1018 * The :mod:`cPickle` module now special-cases dictionaries,
1035 now takes an iterable containing glob-style patterns such as
1091 >>> c.elements() ->
1100 -1
1107 section :ref:`pep-0372`.
1113 of the deque in-place. :class:`~collections.deque` also exposes its maximum
1114 length as the read-only :attr:`~collections.deque.maxlen` attribute.
1143 ... pid-file = /var/run/mysqld/mysqld.pid
1144 ... skip-bdb
1150 >>> print config.get('mysqld', 'skip-bdb')
1185 conversion of a floating-point number to a :class:`~decimal.Decimal`.
1187 closest decimal approximation to the floating-point representation's value;
1194 Comparing instances of :class:`~decimal.Decimal` with floating-point
1199 :class:`Decimal` and floating-point in other operations such as addition,
1204 floating-point numbers (added by Raymond Hettinger; :issue:`8257`)
1205 and non-European Unicode characters such as Arabic-Indic digits
1215 left-alignment. This has been changed to right-alignment, which is
1241 now accept a Unicode-valued payload, automatically converting the
1276 New function: :func:`~functools.cmp_to_key` will take an old-style comparison
1312 now support a *source_address* parameter, a ``(host, port)`` 2-tuple
1371 returns all the possible *r*-length combinations of elements from the
1384 now allows keyword arguments, and using non-integer values such as
1393 * Updated module: The :mod:`json` module was upgraded to version 2.0.9 of the
1398 To support the new :class:`collections.OrderedDict` type, :func:`json.load`
1404 timestamp on the directories it reads, and only re-reads them if the
1411 :func:`~math.expm1` which computes ``e**x - 1`` with more precision than
1442 by Jean-Paul Calderone; :issue:`7333`.)
1444 The :func:`os.fork` function now re-initializes the import lock in
1477 takes a filename, archive type (zip or tar-format), and a directory
1487 * The :mod:`signal` module no longer re-installs the signal handler
1490 Charles-Francois Natali; :issue:`8354`.)
1493 return various site- and user-specific paths.
1495 global site-packages directories,
1497 site-packages directory, and
1509 gained a *source_address* parameter, a ``(host, port)`` 2-tuple
1559 :data:`ssl.OPENSSL_VERSION_INFO` (a 5-tuple), and
1568 attempt to use :meth:`__index__` to convert and pack non-integers
1579 >>> subprocess.check_output(['df', '-h', '.'])
1583 >>> subprocess.check_output(['df', '-h', '/bogus'])
1585 subprocess.CalledProcessError: Command '['df', '-h', '/bogus']' returned non-zero exit status 1
1651 ``://`` is treated as the scheme, even if it's a made-up scheme that
1693 instruction (which looks like ``<?xml-stylesheet href="#style1"?>``)
1694 or comment (which looks like ``<!-- comment -->``).
1697 * The XML-RPC client and server, provided by the :mod:`xmlrpclib` and
1699 supporting HTTP/1.1 keep-alive and by optionally using gzip encoding
1730 .. _importlib-section:
1733 ------------------------------
1735 Python 3.1 includes the :mod:`importlib` package, a re-implementation
1768 ---------------------------------
1771 package, becoming a new top-level module in its own right.
1785 site-specific modules, platform-specific modules, etc.
1794 https://hg.python.org/distutils2/) for developing a next-generation
1799 --------------------------
1801 Tcl/Tk 8.5 includes a set of themed widgets that re-implement basic Tk
1812 https://code.google.com/archive/p/python-ttk/wikis/Screenshots.wiki.
1821 .. _unittest-section:
1824 ---------------------------------
1840 python -m unittest discover -s test
1847 * :option:`-b <unittest -b>` or :option:`!--buffer` will buffer the standard output
1852 * :option:`-c <unittest -c>` or :option:`!--catch` will cause the control-C interrupt
1856 If you're impatient, a second press of control-C will cause an immediate
1859 This control-C handler tries to avoid causing problems when the code
1864 should have the control-C handling disabled.
1866 * :option:`-f <unittest -f>` or :option:`!--failfast` makes
1896 Module- and class-level setup and teardown fixtures are now supported.
2008 .. _elementtree-section:
2011 ---------------------------------
2020 p = ET.XMLParser(encoding='utf-8')
2084 no children. This behaviour is confusing -- ``None`` is false, but
2085 so is a childless element? -- so it will now trigger a
2092 https://web.archive.org/web/20200703234532/http://effbot.org/zone/elementtree-13-intro.htm.
2094 Python, after discussions on python-dev and in :issue:`6472`.)
2108 a file named ``P-gdb.py`` and automatically read it. Dave Malcolm
2109 contributed a :file:`python-gdb.py` that adds a number of
2111 ``py-up`` and ``py-down`` go up or down one Python stack frame,
2112 which usually corresponds to several C stack frames. ``py-print``
2113 prints the value of a Python variable, and ``py-bt`` prints the
2121 * :c:func:`Py_AddPendingCall` is now thread-safe, letting any
2152 * New function: stemming from the rewrite of string-to-float conversion,
2167 put a Trojan-horse module in the directory (say, a file named
2175 Security issue reported as `CVE-2008-5983
2176 <https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2008-5983>`_;
2192 locale-independent way. (Added by Eric Smith;
2195 .. XXX these macros don't seem to be described in the c-api docs.
2222 from this clean-up.
2241 * New configure option: the :option:`!--with-system-expat` switch allows
2246 :option:`!--with-valgrind` option will now disable the pymalloc
2247 allocator, which is difficult for the Valgrind memory-error detector
2253 :option:`!--with-dbmliborder=` in order to disable all of the various
2257 * The :program:`configure` script now checks for floating-point rounding bugs
2258 on certain 32-bit Intel chips and defines a :c:macro:`X87_DOUBLE_ROUNDING`
2267 * The build process now creates the necessary files for pkg-config
2274 .. _whatsnew27-capsules:
2277 -------------------
2295 .. code-block:: c
2309 :ref:`using-capsules` for more information on using these objects.
2312 extension-module APIs, but the :c:func:`PyCObject_AsVoidPtr` was
2313 modified to handle capsules, preserving compile-time compatibility
2324 Port-Specific Changes: Windows
2325 -----------------------------------
2343 the native thread-local storage functions are now used.
2349 will send :kbd:`Control-C` and :kbd:`Control-Break` keystroke events to
2362 Port-Specific Changes: Mac OS X
2363 -----------------------------------
2365 * The path ``/Library/Python/2.7/site-packages`` is now appended to
2367 installation and a user-installed copy of the same version.
2373 ``/Library/Python/2.7/site-packages``, the site-packages directory
2374 used by the Apple-supplied system Python 2.7 is no longer appended to
2375 ``sys.path`` for user-installed Pythons such as from the python.org
2377 site-packages directory is configured, which could cause installation
2379 the system Python will no longer be shared with user-installed
2382 Port-Specific Changes: FreeBSD
2383 -----------------------------------
2395 speed of the built-in file I/O objects returned by :func:`open`
2410 Ziga Seilnacht and Jean-Paul Calderone; :issue:`1180193`.)
2412 * The :file:`regrtest.py` script now takes a :option:`!--randseed=`
2414 for the :option:`!-r` option that executes tests in random order.
2415 The :option:`!-r` option also reports the seed that was used
2418 * Another :file:`regrtest.py` switch is :option:`!-j`, which
2420 allows reducing the total runtime on multi-core machines.
2422 :option:`!-R` switch which is known to produce long runtimes.
2424 with a new :option:`!-F` switch that runs selected tests in a loop
2428 accepts ``'-'`` as an argument, which will read standard input for
2441 consistently; it will now call :meth:`__int__` on non-float,
2442 non-integer arguments that are supplied to it. (Fixed by Alexander
2446 for floating-point and complex numbers from 6 decimal
2453 affects new-style classes (derived from :class:`object`) and C extension
2476 left-alignment. This has been changed to right-alignment, which might
2488 instruction (which looks like ``<?xml-stylesheet href="#style1"?>``)
2489 or comment (which looks like ``<!-- comment -->``).
2493 nothing when a negative length is requested, as other file-like
2511 ``://`` is treated as the scheme, even if it's a made-up scheme that
2557 .. _py27-maintenance-enhancements:
2569 exemption allowing new ``-3`` warnings to be added in any Python 2.7
2574 --------------------------------------------
2589 ----------------------------------------------------
2601 -----------------------------------------------------
2623 python.org. (contributed by Zachary Ware in :issue:`21671` for CVE-2014-0224)
2646 ---------------------------------------------------
2657 cross-platform mechanism to bootstrap the pip installer into Python
2667 For CPython :ref:`source builds on POSIX systems <building-python-on-unix>`,
2677 launcher for Windows as ``py -m pip``.
2684 __ https://peps.python.org/pep-0477/#disabling-ensurepip-by-downstream-distributors
2690 As part of this change, the :ref:`installing-index` and
2691 :ref:`distributing-index` sections of the documentation have been
2699 versions of those guides remaining available as :ref:`install-index`
2700 and :ref:`distutils-index`.
2704 :pep:`453` -- Explicit bootstrapping of pip in Python installations
2709 -----------------------------------------------------------------------------
2731 urllib2.urlopen("https://invalid-cert", context=context)
2735 ----------------------------------------------------------
2757 New ``make regen-all`` build target
2758 -----------------------------------
2760 To simplify cross-compilation, and to ensure that CPython can reliably be
2762 available, the autotools-based build system no longer attempts to implicitly
2765 Instead, a new ``make regen-all`` command has been added to force regeneration
2769 More selective regeneration targets are also defined - see
2778 --------------------------------------
2783 It has been replaced by the new ``make regen-all`` target.
2799 Hugh Secker-Walker.