Python-checkins
Threads by month
- ----- 2025 -----
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2003 -----
- December
- November
- October
- September
- August
March 2021
- 1 participants
- 314 discussions

March 31, 2021
https://github.com/python/cpython/commit/ff3c9739bd69aa8b58007e63c9e40e6708…
commit: ff3c9739bd69aa8b58007e63c9e40e6708b4761e
branch: master
author: Inada Naoki <songofacandy(a)gmail.com>
committer: methane <songofacandy(a)gmail.com>
date: 2021-03-31T14:26:08+09:00
summary:
bpo-43510: PEP 597: Accept `encoding="locale"` in binary mode (GH-25103)
It make `encoding="locale"` usable everywhere `encoding=None` is
allowed.
files:
M Lib/_pyio.py
M Lib/test/test_io.py
M Modules/_io/…
[View More]_iomodule.c
diff --git a/Lib/_pyio.py b/Lib/_pyio.py
index 0f182d4240206..ba0b0a29b5013 100644
--- a/Lib/_pyio.py
+++ b/Lib/_pyio.py
@@ -221,7 +221,7 @@ def open(file, mode="r", buffering=-1, encoding=None, errors=None,
raise ValueError("can't have read/write/append mode at once")
if not (creating or reading or writing or appending):
raise ValueError("must have exactly one of read/write/append mode")
- if binary and encoding is not None:
+ if binary and encoding is not None and encoding != "locale":
raise ValueError("binary mode doesn't take an encoding argument")
if binary and errors is not None:
raise ValueError("binary mode doesn't take an errors argument")
diff --git a/Lib/test/test_io.py b/Lib/test/test_io.py
index c731302a9f22f..6a9ce39f08eb5 100644
--- a/Lib/test/test_io.py
+++ b/Lib/test/test_io.py
@@ -531,6 +531,17 @@ class UnseekableWriter(self.MockUnseekableIO):
self.assertRaises(OSError, obj.truncate)
self.assertRaises(OSError, obj.truncate, 0)
+ def test_open_binmode_encoding(self):
+ """open() raises ValueError when encoding is specified in bin mode"""
+ self.assertRaises(ValueError, self.open, os_helper.TESTFN,
+ "wb", encoding="utf-8")
+
+ # encoding=None and encoding="locale" is allowed.
+ with self.open(os_helper.TESTFN, "wb", encoding=None):
+ pass
+ with self.open(os_helper.TESTFN, "wb", encoding="locale"):
+ pass
+
def test_open_handles_NUL_chars(self):
fn_with_NUL = 'foo\0bar'
self.assertRaises(ValueError, self.open, fn_with_NUL, 'w')
diff --git a/Modules/_io/_iomodule.c b/Modules/_io/_iomodule.c
index 652c2ce5b0d61..c627ca257fd5e 100644
--- a/Modules/_io/_iomodule.c
+++ b/Modules/_io/_iomodule.c
@@ -346,7 +346,8 @@ _io_open_impl(PyObject *module, PyObject *file, const char *mode,
goto error;
}
- if (binary && encoding != NULL) {
+ if (binary && encoding != NULL
+ && strcmp(encoding, "locale") != 0) {
PyErr_SetString(PyExc_ValueError,
"binary mode doesn't take an encoding argument");
goto error;
[View Less]
1
0

March 31, 2021
https://github.com/python/cpython/commit/1b4a9c7956d5dc64f8002f62bf0faae2d1…
commit: 1b4a9c7956d5dc64f8002f62bf0faae2d1892f90
branch: master
author: Terry Jan Reedy <tjreedy(a)udel.edu>
committer: terryjreedy <tjreedy(a)udel.edu>
date: 2021-03-31T01:19:38-04:00
summary:
bpo-42225: IDLE - document two unix-related problems. (#25078)
1. Bad IP masquerade rules can prevent startup.
2. X cannot handle some complex colored chars.
files:
A Misc/NEWS.d/next/IDLE/2021-03-29-16-22-27.bpo-…
[View More]42225.iIeiLg.rst
M Doc/library/idle.rst
M Lib/idlelib/help.html
diff --git a/Doc/library/idle.rst b/Doc/library/idle.rst
index 2b9bd4b5daaa7..6ef15653eacb5 100644
--- a/Doc/library/idle.rst
+++ b/Doc/library/idle.rst
@@ -670,8 +670,16 @@ IDLE uses a socket to communicate between the IDLE GUI process and the user
code execution process. A connection must be established whenever the Shell
starts or restarts. (The latter is indicated by a divider line that says
'RESTART'). If the user process fails to connect to the GUI process, it
-displays a ``Tk`` error box with a 'cannot connect' message that directs the
-user here. It then exits.
+usually displays a ``Tk`` error box with a 'cannot connect' message
+that directs the user here. It then exits.
+
+One specific connection failure on Unix systems results from
+misconfigured masquerading rules somewhere in a system's network setup.
+When IDLE is started from a terminal, one will see a message starting
+with ``** Invalid host:``.
+The valid value is ``127.0.0.1 (idlelib.rpc.LOCALHOST)``.
+One can diagnose with ``tcpconnect -irv 127.0.0.1 6543`` in one
+terminal window and ``tcplisten <same args>`` in another.
A common cause of failure is a user-written file with the same name as a
standard library module, such as *random.py* and *tkinter.py*. When such a
@@ -709,6 +717,13 @@ If IDLE quits with no message, and it was not started from a console, try
starting it from a console or terminal (``python -m idlelib``) and see if
this results in an error message.
+On Unix-based systems with tcl/tk older than ``8.6.11`` (see
+``About IDLE``) certain characters of certain fonts can cause
+a tk failure with a message to the terminal. This can happen either
+if one starts IDLE to edit a file with such a character or later
+when entering such a character. If one cannot upgrade tcl/tk,
+then re-configure IDLE to use a font that works better.
+
Running user code
^^^^^^^^^^^^^^^^^
diff --git a/Lib/idlelib/help.html b/Lib/idlelib/help.html
index 924042d25b7ba..e80384b777522 100644
--- a/Lib/idlelib/help.html
+++ b/Lib/idlelib/help.html
@@ -5,7 +5,7 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
- <title>IDLE — Python 3.10.0a5 documentation</title>
+ <title>IDLE — Python 3.10.0a6 documentation</title>
<link rel="stylesheet" href="../_static/pydoctheme.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
@@ -18,7 +18,7 @@
<script src="../_static/sidebar.js"></script>
<link rel="search" type="application/opensearchdescription+xml"
- title="Search within Python 3.10.0a5 documentation"
+ title="Search within Python 3.10.0a6 documentation"
href="../_static/opensearch.xml"/>
<link rel="author" title="About these documents" href="../about.html" />
<link rel="index" title="Index" href="../genindex.html" />
@@ -71,7 +71,7 @@ <h3>Navigation</h3>
<li id="cpython-language-and-version">
- <a href="../index.html">3.10.0a5 Documentation</a> »
+ <a href="../index.html">3.10.0a6 Documentation</a> »
</li>
<li class="nav-item nav-item-1"><a href="index.html" >The Python Standard Library</a> »</li>
@@ -632,8 +632,15 @@ <h3>Startup failure<a class="headerlink" href="#startup-failure" title="Permalin
code execution process. A connection must be established whenever the Shell
starts or restarts. (The latter is indicated by a divider line that says
‘RESTART’). If the user process fails to connect to the GUI process, it
-displays a <code class="docutils literal notranslate"><span class="pre">Tk</span></code> error box with a ‘cannot connect’ message that directs the
-user here. It then exits.</p>
+usually displays a <code class="docutils literal notranslate"><span class="pre">Tk</span></code> error box with a ‘cannot connect’ message
+that directs the user here. It then exits.</p>
+<p>One specific connection failure on Unix systems results from
+misconfigured masquerading rules somewhere in a system’s network setup.
+When IDLE is started from a terminal, one will see a message starting
+with <code class="docutils literal notranslate"><span class="pre">**</span> <span class="pre">Invalid</span> <span class="pre">host:</span></code>.
+The valid value is <code class="docutils literal notranslate"><span class="pre">127.0.0.1</span> <span class="pre">(idlelib.rpc.LOCALHOST)</span></code>.
+One can diagnose with <code class="docutils literal notranslate"><span class="pre">tcpconnect</span> <span class="pre">-irv</span> <span class="pre">127.0.0.1</span> <span class="pre">6543</span></code> in one
+terminal window and <code class="docutils literal notranslate"><span class="pre">tcplisten</span> <span class="pre"><same</span> <span class="pre">args></span></code> in another.</p>
<p>A common cause of failure is a user-written file with the same name as a
standard library module, such as <em>random.py</em> and <em>tkinter.py</em>. When such a
file is located in the same directory as a file that is about to be run,
@@ -664,6 +671,12 @@ <h3>Startup failure<a class="headerlink" href="#startup-failure" title="Permalin
<p>If IDLE quits with no message, and it was not started from a console, try
starting it from a console or terminal (<code class="docutils literal notranslate"><span class="pre">python</span> <span class="pre">-m</span> <span class="pre">idlelib</span></code>) and see if
this results in an error message.</p>
+<p>On Unix-based systems with tcl/tk older than <code class="docutils literal notranslate"><span class="pre">8.6.11</span></code> (see
+<code class="docutils literal notranslate"><span class="pre">About</span> <span class="pre">IDLE</span></code>) certain characters of certain fonts can cause
+a tk failure with a message to the terminal. This can happen either
+if one starts IDLE to edit a file with such a character or later
+when entering such a character. If one cannot upgrade tcl/tk,
+then re-configure IDLE to use a font that works better.</p>
</div>
<div class="section" id="running-user-code">
<h3>Running user code<a class="headerlink" href="#running-user-code" title="Permalink to this headline">¶</a></h3>
@@ -958,7 +971,7 @@ <h3>Navigation</h3>
<li id="cpython-language-and-version">
- <a href="../index.html">3.10.0a5 Documentation</a> »
+ <a href="../index.html">3.10.0a6 Documentation</a> »
</li>
<li class="nav-item nav-item-1"><a href="index.html" >The Python Standard Library</a> »</li>
@@ -990,7 +1003,7 @@ <h3>Navigation</h3>
<br />
<br />
- Last updated on Feb 23, 2021.
+ Last updated on Mar 29, 2021.
<a href="https://docs.python.org/3/bugs.html">Found a bug</a>?
<br />
diff --git a/Misc/NEWS.d/next/IDLE/2021-03-29-16-22-27.bpo-42225.iIeiLg.rst b/Misc/NEWS.d/next/IDLE/2021-03-29-16-22-27.bpo-42225.iIeiLg.rst
new file mode 100644
index 0000000000000..59fb08bdf9ebe
--- /dev/null
+++ b/Misc/NEWS.d/next/IDLE/2021-03-29-16-22-27.bpo-42225.iIeiLg.rst
@@ -0,0 +1,2 @@
+Document that IDLE can fail on Unix either from misconfigured IP masquerage
+rules or failure displaying complex colored (non-ascii) characters.
[View Less]
1
0

March 31, 2021
https://github.com/python/cpython/commit/b775106d940e3d77c8af7967545bb9a5b7…
commit: b775106d940e3d77c8af7967545bb9a5b7b162df
branch: master
author: Ethan Furman <ethan(a)stoneleaf.us>
committer: ethanfurman <ethan(a)stoneleaf.us>
date: 2021-03-30T21:17:26-07:00
summary:
bpo-40066: Enum: modify `repr()` and `str()` (GH-22392)
* Enum: streamline repr() and str(); improve docs
- repr() is now ``enum_class.member_name``
- stdlib global enums are ``module_name.member_name``
- str() …
[View More]is now ``member_name``
- add HOW-TO section for ``Enum``
- change main documentation to be an API reference
files:
A Doc/howto/enum.rst
A Misc/NEWS.d/next/Library/2020-09-23-21-58-34.bpo-40066.f1dr_5.rst
A Misc/NEWS.d/next/Library/2021-03-25-21-26-30.bpo-40066.7EBQ3_.rst
M Doc/howto/index.rst
M Doc/library/enum.rst
M Doc/library/http.rst
M Doc/library/socket.rst
M Doc/library/ssl.rst
M Doc/whatsnew/3.10.rst
M Lib/enum.py
M Lib/inspect.py
M Lib/plistlib.py
M Lib/re.py
M Lib/test/test_enum.py
M Lib/test/test_pydoc.py
M Lib/test/test_signal.py
M Lib/test/test_socket.py
M Lib/test/test_ssl.py
M Lib/test/test_unicode.py
diff --git a/Doc/howto/enum.rst b/Doc/howto/enum.rst
new file mode 100644
index 0000000000000..9ece93e660504
--- /dev/null
+++ b/Doc/howto/enum.rst
@@ -0,0 +1,1416 @@
+==========
+Enum HOWTO
+==========
+
+:Author: Ethan Furman <ethan at stoneleaf dot us>
+
+.. _enum-basic-tutorial:
+
+.. currentmodule:: enum
+
+Basic Enum Tutorial
+-------------------
+
+An :class:`Enum` is a set of symbolic names bound to unique values. They are
+similar to global variables, but they offer a more useful :func:`repr()`,
+grouping, type-safety, and a few other features.
+
+They are most useful when you have a variable that can take one of a limited
+selection of values. For example, the days of the week::
+
+ >>> from enum import Enum
+ >>> class Weekday(Enum):
+ ... MONDAY = 1
+ ... TUESDAY = 2
+ ... WEDNESDAY = 3
+ ... THURSDAY = 4
+ ... FRIDAY = 5
+ ... SATURDAY = 6
+ ... SUNDAY = 7
+
+As you can see, creating an :class:`Enum` is as simple as writing a class that
+inherits from :class:`Enum` itself.
+
+.. note:: Case of Enum Members
+
+ Because Enums are used to represent constants we recommend using
+ UPPER_CASE names for members, and will be using that style in our examples.
+
+Depending on the nature of the enum a member's value may or may not be
+important, but either way that value can be used to get the corresponding
+member::
+
+ >>> Weekday(3)
+ Weekday.WEDNESDAY
+
+As you can see, the ``repr()`` of a member shows the enum name and the
+member name. The ``str()`` on a member shows only its name::
+
+ >>> print(Weekday.THURSDAY)
+ THURSDAY
+
+The *type* of an enumeration member is the enum it belongs to::
+
+ >>> type(Weekday.MONDAY)
+ <enum 'Weekday'>
+ >>> isinstance(Weekday.FRIDAY, Weekday)
+ True
+
+Enum members have an attribute that contains just their :attr:`name`::
+
+ >>> print(Weekday.TUESDAY.name)
+ TUESDAY
+
+Likewise, they have an attribute for their :attr:`value`::
+
+
+ >>> Weekday.WEDNESDAY.value
+ 3
+
+Unlike many languages that treat enumerations solely as name/value pairs,
+Python Enums can have behavior added. For example, :class:`datetime.date`
+has two methods for returning the weekday: :meth:`weekday` and :meth:`isoweekday`.
+The difference is that one of them counts from 0-6 and the other from 1-7.
+Rather than keep track of that ourselves we can add a method to the :class:`Weekday`
+enum to extract the day from the :class:`date` instance and return the matching
+enum member::
+
+ @classmethod
+ def from_date(cls, date):
+ return cls(date.isoweekday())
+
+The complete :class:`Weekday` enum now looks like this::
+
+ >>> class Weekday(Enum):
+ ... MONDAY = 1
+ ... TUESDAY = 2
+ ... WEDNESDAY = 3
+ ... THURSDAY = 4
+ ... FRIDAY = 5
+ ... SATURDAY = 6
+ ... SUNDAY = 7
+ ... #
+ ... @classmethod
+ ... def from_date(cls, date):
+ ... return cls(date.isoweekday())
+
+Now we can find out what today is! Observe::
+
+ >>> from datetime import date
+ >>> Weekday.from_date(date.today())
+ Weekday.TUESDAY
+
+Of course, if you're reading this on some other day, you'll see that day instead.
+
+This :class:`Weekday` enum is great if our variable only needs one day, but
+what if we need several? Maybe we're writing a function to plot chores during
+a week, and don't want to use a :class:`list` -- we could use a different type
+of :class:`Enum`::
+
+ >>> from enum import Flag
+ >>> class Weekday(Flag):
+ ... MONDAY = 1
+ ... TUESDAY = 2
+ ... WEDNESDAY = 4
+ ... THURSDAY = 8
+ ... FRIDAY = 16
+ ... SATURDAY = 32
+ ... SUNDAY = 64
+
+We've changed two things: we're inherited from :class:`Flag`, and the values are
+all powers of 2.
+
+Just like the original :class:`Weekday` enum above, we can have a single selection::
+
+ >>> first_week_day = Weekday.MONDAY
+ >>> first_week_day
+ Weekday.MONDAY
+
+But :class:`Flag` also allows us to combine several members into a single
+variable::
+
+ >>> weekend = Weekday.SATURDAY | Weekday.SUNDAY
+ >>> weekend
+ Weekday.SATURDAY|Weekday.SUNDAY
+
+You can even iterate over a :class:`Flag` variable::
+
+ >>> for day in weekend:
+ ... print(day)
+ SATURDAY
+ SUNDAY
+
+Okay, let's get some chores set up::
+
+ >>> chores_for_ethan = {
+ ... 'feed the cat': Weekday.MONDAY | Weekday.WEDNESDAY | Weekday.FRIDAY,
+ ... 'do the dishes': Weekday.TUESDAY | Weekday.THURSDAY,
+ ... 'answer SO questions': Weekday.SATURDAY,
+ ... }
+
+And a function to display the chores for a given day::
+
+ >>> def show_chores(chores, day):
+ ... for chore, days in chores.items():
+ ... if day in days:
+ ... print(chore)
+ >>> show_chores(chores_for_ethan, Weekday.SATURDAY)
+ answer SO questions
+
+In cases where the actual values of the members do not matter, you can save
+yourself some work and use :func:`auto()` for the values::
+
+ >>> from enum import auto
+ >>> class Weekday(Flag):
+ ... MONDAY = auto()
+ ... TUESDAY = auto()
+ ... WEDNESDAY = auto()
+ ... THURSDAY = auto()
+ ... FRIDAY = auto()
+ ... SATURDAY = auto()
+ ... SUNDAY = auto()
+
+
+.. _enum-advanced-tutorial:
+
+Programmatic access to enumeration members and their attributes
+---------------------------------------------------------------
+
+Sometimes it's useful to access members in enumerations programmatically (i.e.
+situations where ``Color.RED`` won't do because the exact color is not known
+at program-writing time). ``Enum`` allows such access::
+
+ >>> Color(1)
+ Color.RED
+ >>> Color(3)
+ Color.BLUE
+
+If you want to access enum members by *name*, use item access::
+
+ >>> Color['RED']
+ Color.RED
+ >>> Color['GREEN']
+ Color.GREEN
+
+If you have an enum member and need its :attr:`name` or :attr:`value`::
+
+ >>> member = Color.RED
+ >>> member.name
+ 'RED'
+ >>> member.value
+ 1
+
+
+Duplicating enum members and values
+-----------------------------------
+
+Having two enum members with the same name is invalid::
+
+ >>> class Shape(Enum):
+ ... SQUARE = 2
+ ... SQUARE = 3
+ ...
+ Traceback (most recent call last):
+ ...
+ TypeError: 'SQUARE' already defined as: 2
+
+However, an enum member can have other names associated with it. Given two
+entries ``A`` and ``B`` with the same value (and ``A`` defined first), ``B``
+is an alias for the member ``A``. By-value lookup of the value of ``A`` will
+return the member ``A``. By-name lookup of ``A`` will return the member ``A``.
+By-name lookup of ``B`` will also return the member ``A``::
+
+ >>> class Shape(Enum):
+ ... SQUARE = 2
+ ... DIAMOND = 1
+ ... CIRCLE = 3
+ ... ALIAS_FOR_SQUARE = 2
+ ...
+ >>> Shape.SQUARE
+ Shape.SQUARE
+ >>> Shape.ALIAS_FOR_SQUARE
+ Shape.SQUARE
+ >>> Shape(2)
+ Shape.SQUARE
+
+.. note::
+
+ Attempting to create a member with the same name as an already
+ defined attribute (another member, a method, etc.) or attempting to create
+ an attribute with the same name as a member is not allowed.
+
+
+Ensuring unique enumeration values
+----------------------------------
+
+By default, enumerations allow multiple names as aliases for the same value.
+When this behavior isn't desired, you can use the :func:`unique` decorator::
+
+ >>> from enum import Enum, unique
+ >>> @unique
+ ... class Mistake(Enum):
+ ... ONE = 1
+ ... TWO = 2
+ ... THREE = 3
+ ... FOUR = 3
+ ...
+ Traceback (most recent call last):
+ ...
+ ValueError: duplicate values found in <enum 'Mistake'>: FOUR -> THREE
+
+
+Using automatic values
+----------------------
+
+If the exact value is unimportant you can use :class:`auto`::
+
+ >>> from enum import Enum, auto
+ >>> class Color(Enum):
+ ... RED = auto()
+ ... BLUE = auto()
+ ... GREEN = auto()
+ ...
+ >>> [member.value for member in Color]
+ [1, 2, 3]
+
+The values are chosen by :func:`_generate_next_value_`, which can be
+overridden::
+
+ >>> class AutoName(Enum):
+ ... def _generate_next_value_(name, start, count, last_values):
+ ... return name
+ ...
+ >>> class Ordinal(AutoName):
+ ... NORTH = auto()
+ ... SOUTH = auto()
+ ... EAST = auto()
+ ... WEST = auto()
+ ...
+ >>> [member.value for member in Color]
+ ['NORTH', 'SOUTH', 'EAST', 'WEST']
+
+.. note::
+
+ The :meth:`_generate_next_value_` method must be defined before any members.
+
+Iteration
+---------
+
+Iterating over the members of an enum does not provide the aliases::
+
+ >>> list(Shape)
+ [Shape.SQUARE, Shape.DIAMOND, Shape.CIRCLE]
+
+The special attribute ``__members__`` is a read-only ordered mapping of names
+to members. It includes all names defined in the enumeration, including the
+aliases::
+
+ >>> for name, member in Shape.__members__.items():
+ ... name, member
+ ...
+ ('SQUARE', Shape.SQUARE)
+ ('DIAMOND', Shape.DIAMOND)
+ ('CIRCLE', Shape.CIRCLE)
+ ('ALIAS_FOR_SQUARE', Shape.SQUARE)
+
+The ``__members__`` attribute can be used for detailed programmatic access to
+the enumeration members. For example, finding all the aliases::
+
+ >>> [name for name, member in Shape.__members__.items() if member.name != name]
+ ['ALIAS_FOR_SQUARE']
+
+
+Comparisons
+-----------
+
+Enumeration members are compared by identity::
+
+ >>> Color.RED is Color.RED
+ True
+ >>> Color.RED is Color.BLUE
+ False
+ >>> Color.RED is not Color.BLUE
+ True
+
+Ordered comparisons between enumeration values are *not* supported. Enum
+members are not integers (but see `IntEnum`_ below)::
+
+ >>> Color.RED < Color.BLUE
+ Traceback (most recent call last):
+ File "<stdin>", line 1, in <module>
+ TypeError: '<' not supported between instances of 'Color' and 'Color'
+
+Equality comparisons are defined though::
+
+ >>> Color.BLUE == Color.RED
+ False
+ >>> Color.BLUE != Color.RED
+ True
+ >>> Color.BLUE == Color.BLUE
+ True
+
+Comparisons against non-enumeration values will always compare not equal
+(again, :class:`IntEnum` was explicitly designed to behave differently, see
+below)::
+
+ >>> Color.BLUE == 2
+ False
+
+
+Allowed members and attributes of enumerations
+----------------------------------------------
+
+Most of the examples above use integers for enumeration values. Using integers is
+short and handy (and provided by default by the `Functional API`_), but not
+strictly enforced. In the vast majority of use-cases, one doesn't care what
+the actual value of an enumeration is. But if the value *is* important,
+enumerations can have arbitrary values.
+
+Enumerations are Python classes, and can have methods and special methods as
+usual. If we have this enumeration::
+
+ >>> class Mood(Enum):
+ ... FUNKY = 1
+ ... HAPPY = 3
+ ...
+ ... def describe(self):
+ ... # self is the member here
+ ... return self.name, self.value
+ ...
+ ... def __str__(self):
+ ... return 'my custom str! {0}'.format(self.value)
+ ...
+ ... @classmethod
+ ... def favorite_mood(cls):
+ ... # cls here is the enumeration
+ ... return cls.HAPPY
+ ...
+
+Then::
+
+ >>> Mood.favorite_mood()
+ Mood.HAPPY
+ >>> Mood.HAPPY.describe()
+ ('HAPPY', 3)
+ >>> str(Mood.FUNKY)
+ 'my custom str! 1'
+
+The rules for what is allowed are as follows: names that start and end with
+a single underscore are reserved by enum and cannot be used; all other
+attributes defined within an enumeration will become members of this
+enumeration, with the exception of special methods (:meth:`__str__`,
+:meth:`__add__`, etc.), descriptors (methods are also descriptors), and
+variable names listed in :attr:`_ignore_`.
+
+Note: if your enumeration defines :meth:`__new__` and/or :meth:`__init__` then
+any value(s) given to the enum member will be passed into those methods.
+See `Planet`_ for an example.
+
+
+Restricted Enum subclassing
+---------------------------
+
+A new :class:`Enum` class must have one base enum class, up to one concrete
+data type, and as many :class:`object`-based mixin classes as needed. The
+order of these base classes is::
+
+ class EnumName([mix-in, ...,] [data-type,] base-enum):
+ pass
+
+Also, subclassing an enumeration is allowed only if the enumeration does not define
+any members. So this is forbidden::
+
+ >>> class MoreColor(Color):
+ ... PINK = 17
+ ...
+ Traceback (most recent call last):
+ ...
+ TypeError: MoreColor: cannot extend enumeration 'Color'
+
+But this is allowed::
+
+ >>> class Foo(Enum):
+ ... def some_behavior(self):
+ ... pass
+ ...
+ >>> class Bar(Foo):
+ ... HAPPY = 1
+ ... SAD = 2
+ ...
+
+Allowing subclassing of enums that define members would lead to a violation of
+some important invariants of types and instances. On the other hand, it makes
+sense to allow sharing some common behavior between a group of enumerations.
+(See `OrderedEnum`_ for an example.)
+
+
+Pickling
+--------
+
+Enumerations can be pickled and unpickled::
+
+ >>> from test.test_enum import Fruit
+ >>> from pickle import dumps, loads
+ >>> Fruit.TOMATO is loads(dumps(Fruit.TOMATO))
+ True
+
+The usual restrictions for pickling apply: picklable enums must be defined in
+the top level of a module, since unpickling requires them to be importable
+from that module.
+
+.. note::
+
+ With pickle protocol version 4 it is possible to easily pickle enums
+ nested in other classes.
+
+It is possible to modify how enum members are pickled/unpickled by defining
+:meth:`__reduce_ex__` in the enumeration class.
+
+
+Functional API
+--------------
+
+The :class:`Enum` class is callable, providing the following functional API::
+
+ >>> Animal = Enum('Animal', 'ANT BEE CAT DOG')
+ >>> Animal
+ <enum 'Animal'>
+ >>> Animal.ANT
+ Animal.ANT
+ >>> Animal.ANT.value
+ 1
+ >>> list(Animal)
+ [Animal.ANT, Animal.BEE, Animal.CAT, Animal.DOG]
+
+The semantics of this API resemble :class:`~collections.namedtuple`. The first
+argument of the call to :class:`Enum` is the name of the enumeration.
+
+The second argument is the *source* of enumeration member names. It can be a
+whitespace-separated string of names, a sequence of names, a sequence of
+2-tuples with key/value pairs, or a mapping (e.g. dictionary) of names to
+values. The last two options enable assigning arbitrary values to
+enumerations; the others auto-assign increasing integers starting with 1 (use
+the ``start`` parameter to specify a different starting value). A
+new class derived from :class:`Enum` is returned. In other words, the above
+assignment to :class:`Animal` is equivalent to::
+
+ >>> class Animal(Enum):
+ ... ANT = 1
+ ... BEE = 2
+ ... CAT = 3
+ ... DOG = 4
+ ...
+
+The reason for defaulting to ``1`` as the starting number and not ``0`` is
+that ``0`` is ``False`` in a boolean sense, but by default enum members all
+evaluate to ``True``.
+
+Pickling enums created with the functional API can be tricky as frame stack
+implementation details are used to try and figure out which module the
+enumeration is being created in (e.g. it will fail if you use a utility
+function in separate module, and also may not work on IronPython or Jython).
+The solution is to specify the module name explicitly as follows::
+
+ >>> Animal = Enum('Animal', 'ANT BEE CAT DOG', module=__name__)
+
+.. warning::
+
+ If ``module`` is not supplied, and Enum cannot determine what it is,
+ the new Enum members will not be unpicklable; to keep errors closer to
+ the source, pickling will be disabled.
+
+The new pickle protocol 4 also, in some circumstances, relies on
+:attr:`~definition.__qualname__` being set to the location where pickle will be able
+to find the class. For example, if the class was made available in class
+SomeData in the global scope::
+
+ >>> Animal = Enum('Animal', 'ANT BEE CAT DOG', qualname='SomeData.Animal')
+
+The complete signature is::
+
+ Enum(
+ value='NewEnumName',
+ names=<...>,
+ *,
+ module='...',
+ qualname='...',
+ type=<mixed-in class>,
+ start=1,
+ )
+
+:value: What the new enum class will record as its name.
+
+:names: The enum members. This can be a whitespace or comma separated string
+ (values will start at 1 unless otherwise specified)::
+
+ 'RED GREEN BLUE' | 'RED,GREEN,BLUE' | 'RED, GREEN, BLUE'
+
+ or an iterator of names::
+
+ ['RED', 'GREEN', 'BLUE']
+
+ or an iterator of (name, value) pairs::
+
+ [('CYAN', 4), ('MAGENTA', 5), ('YELLOW', 6)]
+
+ or a mapping::
+
+ {'CHARTREUSE': 7, 'SEA_GREEN': 11, 'ROSEMARY': 42}
+
+:module: name of module where new enum class can be found.
+
+:qualname: where in module new enum class can be found.
+
+:type: type to mix in to new enum class.
+
+:start: number to start counting at if only names are passed in.
+
+.. versionchanged:: 3.5
+ The *start* parameter was added.
+
+
+Derived Enumerations
+--------------------
+
+IntEnum
+^^^^^^^
+
+The first variation of :class:`Enum` that is provided is also a subclass of
+:class:`int`. Members of an :class:`IntEnum` can be compared to integers;
+by extension, integer enumerations of different types can also be compared
+to each other::
+
+ >>> from enum import IntEnum
+ >>> class Shape(IntEnum):
+ ... CIRCLE = 1
+ ... SQUARE = 2
+ ...
+ >>> class Request(IntEnum):
+ ... POST = 1
+ ... GET = 2
+ ...
+ >>> Shape == 1
+ False
+ >>> Shape.CIRCLE == 1
+ True
+ >>> Shape.CIRCLE == Request.POST
+ True
+
+However, they still can't be compared to standard :class:`Enum` enumerations::
+
+ >>> class Shape(IntEnum):
+ ... CIRCLE = 1
+ ... SQUARE = 2
+ ...
+ >>> class Color(Enum):
+ ... RED = 1
+ ... GREEN = 2
+ ...
+ >>> Shape.CIRCLE == Color.RED
+ False
+
+:class:`IntEnum` values behave like integers in other ways you'd expect::
+
+ >>> int(Shape.CIRCLE)
+ 1
+ >>> ['a', 'b', 'c'][Shape.CIRCLE]
+ 'b'
+ >>> [i for i in range(Shape.SQUARE)]
+ [0, 1]
+
+
+StrEnum
+^^^^^^^
+
+The second variation of :class:`Enum` that is provided is also a subclass of
+:class:`str`. Members of a :class:`StrEnum` can be compared to strings;
+by extension, string enumerations of different types can also be compared
+to each other. :class:`StrEnum` exists to help avoid the problem of getting
+an incorrect member::
+
+ >>> from enum import StrEnum
+ >>> class Directions(StrEnum):
+ ... NORTH = 'north', # notice the trailing comma
+ ... SOUTH = 'south'
+
+Before :class:`StrEnum`, ``Directions.NORTH`` would have been the :class:`tuple`
+``('north',)``.
+
+.. versionadded:: 3.10
+
+
+IntFlag
+^^^^^^^
+
+The next variation of :class:`Enum` provided, :class:`IntFlag`, is also based
+on :class:`int`. The difference being :class:`IntFlag` members can be combined
+using the bitwise operators (&, \|, ^, ~) and the result is still an
+:class:`IntFlag` member, if possible. However, as the name implies, :class:`IntFlag`
+members also subclass :class:`int` and can be used wherever an :class:`int` is
+used.
+
+.. note::
+
+ Any operation on an :class:`IntFlag` member besides the bit-wise operations will
+ lose the :class:`IntFlag` membership.
+
+ Bit-wise operations that result in invalid :class:`IntFlag` values will lose the
+ :class:`IntFlag` membership. See :class:`FlagBoundary` for
+ details.
+
+.. versionadded:: 3.6
+.. versionchanged:: 3.10
+
+Sample :class:`IntFlag` class::
+
+ >>> from enum import IntFlag
+ >>> class Perm(IntFlag):
+ ... R = 4
+ ... W = 2
+ ... X = 1
+ ...
+ >>> Perm.R | Perm.W
+ Perm.R|Perm.W
+ >>> Perm.R + Perm.W
+ 6
+ >>> RW = Perm.R | Perm.W
+ >>> Perm.R in RW
+ True
+
+It is also possible to name the combinations::
+
+ >>> class Perm(IntFlag):
+ ... R = 4
+ ... W = 2
+ ... X = 1
+ ... RWX = 7
+ >>> Perm.RWX
+ Perm.RWX
+ >>> ~Perm.RWX
+ Perm(0)
+ >>> Perm(7)
+ Perm.RWX
+
+.. note::
+
+ Named combinations are considered aliases. Aliases do not show up during
+ iteration, but can be returned from by-value lookups.
+
+.. versionchanged:: 3.10
+
+Another important difference between :class:`IntFlag` and :class:`Enum` is that
+if no flags are set (the value is 0), its boolean evaluation is :data:`False`::
+
+ >>> Perm.R & Perm.X
+ Perm(0)
+ >>> bool(Perm.R & Perm.X)
+ False
+
+Because :class:`IntFlag` members are also subclasses of :class:`int` they can
+be combined with them (but may lose :class:`IntFlag` membership::
+
+ >>> Perm.X | 4
+ Perm.R|Perm.X
+
+ >>> Perm.X | 8
+ 9
+
+.. note::
+
+ The negation operator, ``~``, always returns an :class:`IntFlag` member with a
+ positive value::
+
+ >>> (~Perm.X).value == (Perm.R|Perm.W).value == 6
+ True
+
+:class:`IntFlag` members can also be iterated over::
+
+ >>> list(RW)
+ [Perm.R, Perm.W]
+
+.. versionadded:: 3.10
+
+
+Flag
+^^^^
+
+The last variation is :class:`Flag`. Like :class:`IntFlag`, :class:`Flag`
+members can be combined using the bitwise operators (&, \|, ^, ~). Unlike
+:class:`IntFlag`, they cannot be combined with, nor compared against, any
+other :class:`Flag` enumeration, nor :class:`int`. While it is possible to
+specify the values directly it is recommended to use :class:`auto` as the
+value and let :class:`Flag` select an appropriate value.
+
+.. versionadded:: 3.6
+
+Like :class:`IntFlag`, if a combination of :class:`Flag` members results in no
+flags being set, the boolean evaluation is :data:`False`::
+
+ >>> from enum import Flag, auto
+ >>> class Color(Flag):
+ ... RED = auto()
+ ... BLUE = auto()
+ ... GREEN = auto()
+ ...
+ >>> Color.RED & Color.GREEN
+ Color(0)
+ >>> bool(Color.RED & Color.GREEN)
+ False
+
+Individual flags should have values that are powers of two (1, 2, 4, 8, ...),
+while combinations of flags won't::
+
+ >>> class Color(Flag):
+ ... RED = auto()
+ ... BLUE = auto()
+ ... GREEN = auto()
+ ... WHITE = RED | BLUE | GREEN
+ ...
+ >>> Color.WHITE
+ Color.WHITE
+
+Giving a name to the "no flags set" condition does not change its boolean
+value::
+
+ >>> class Color(Flag):
+ ... BLACK = 0
+ ... RED = auto()
+ ... BLUE = auto()
+ ... GREEN = auto()
+ ...
+ >>> Color.BLACK
+ Color.BLACK
+ >>> bool(Color.BLACK)
+ False
+
+:class:`Flag` members can also be iterated over::
+
+ >>> purple = Color.RED | Color.BLUE
+ >>> list(purple)
+ [Color.RED, Color.BLUE]
+
+.. versionadded:: 3.10
+
+.. note::
+
+ For the majority of new code, :class:`Enum` and :class:`Flag` are strongly
+ recommended, since :class:`IntEnum` and :class:`IntFlag` break some
+ semantic promises of an enumeration (by being comparable to integers, and
+ thus by transitivity to other unrelated enumerations). :class:`IntEnum`
+ and :class:`IntFlag` should be used only in cases where :class:`Enum` and
+ :class:`Flag` will not do; for example, when integer constants are replaced
+ with enumerations, or for interoperability with other systems.
+
+
+Others
+^^^^^^
+
+While :class:`IntEnum` is part of the :mod:`enum` module, it would be very
+simple to implement independently::
+
+ class IntEnum(int, Enum):
+ pass
+
+This demonstrates how similar derived enumerations can be defined; for example
+a :class:`StrEnum` that mixes in :class:`str` instead of :class:`int`.
+
+Some rules:
+
+1. When subclassing :class:`Enum`, mix-in types must appear before
+ :class:`Enum` itself in the sequence of bases, as in the :class:`IntEnum`
+ example above.
+2. While :class:`Enum` can have members of any type, once you mix in an
+ additional type, all the members must have values of that type, e.g.
+ :class:`int` above. This restriction does not apply to mix-ins which only
+ add methods and don't specify another type.
+3. When another data type is mixed in, the :attr:`value` attribute is *not the
+ same* as the enum member itself, although it is equivalent and will compare
+ equal.
+4. %-style formatting: `%s` and `%r` call the :class:`Enum` class's
+ :meth:`__str__` and :meth:`__repr__` respectively; other codes (such as
+ `%i` or `%h` for IntEnum) treat the enum member as its mixed-in type.
+5. :ref:`Formatted string literals <f-strings>`, :meth:`str.format`,
+ and :func:`format` will use the mixed-in type's :meth:`__format__`
+ unless :meth:`__str__` or :meth:`__format__` is overridden in the subclass,
+ in which case the overridden methods or :class:`Enum` methods will be used.
+ Use the !s and !r format codes to force usage of the :class:`Enum` class's
+ :meth:`__str__` and :meth:`__repr__` methods.
+
+When to use :meth:`__new__` vs. :meth:`__init__`
+------------------------------------------------
+
+:meth:`__new__` must be used whenever you want to customize the actual value of
+the :class:`Enum` member. Any other modifications may go in either
+:meth:`__new__` or :meth:`__init__`, with :meth:`__init__` being preferred.
+
+For example, if you want to pass several items to the constructor, but only
+want one of them to be the value::
+
+ >>> class Coordinate(bytes, Enum):
+ ... """
+ ... Coordinate with binary codes that can be indexed by the int code.
+ ... """
+ ... def __new__(cls, value, label, unit):
+ ... obj = bytes.__new__(cls, [value])
+ ... obj._value_ = value
+ ... obj.label = label
+ ... obj.unit = unit
+ ... return obj
+ ... PX = (0, 'P.X', 'km')
+ ... PY = (1, 'P.Y', 'km')
+ ... VX = (2, 'V.X', 'km/s')
+ ... VY = (3, 'V.Y', 'km/s')
+ ...
+
+ >>> print(Coordinate['PY'])
+ PY
+
+ >>> print(Coordinate(3))
+ VY
+
+
+Finer Points
+^^^^^^^^^^^^
+
+Supported ``__dunder__`` names
+""""""""""""""""""""""""""""""
+
+:attr:`__members__` is a read-only ordered mapping of ``member_name``:``member``
+items. It is only available on the class.
+
+:meth:`__new__`, if specified, must create and return the enum members; it is
+also a very good idea to set the member's :attr:`_value_` appropriately. Once
+all the members are created it is no longer used.
+
+
+Supported ``_sunder_`` names
+""""""""""""""""""""""""""""
+
+- ``_name_`` -- name of the member
+- ``_value_`` -- value of the member; can be set / modified in ``__new__``
+
+- ``_missing_`` -- a lookup function used when a value is not found; may be
+ overridden
+- ``_ignore_`` -- a list of names, either as a :class:`list` or a :class:`str`,
+ that will not be transformed into members, and will be removed from the final
+ class
+- ``_order_`` -- used in Python 2/3 code to ensure member order is consistent
+ (class attribute, removed during class creation)
+- ``_generate_next_value_`` -- used by the `Functional API`_ and by
+ :class:`auto` to get an appropriate value for an enum member; may be
+ overridden
+
+.. note::
+
+ For standard :class:`Enum` classes the next value chosen is the last value seen
+ incremented by one.
+
+ For :class:`Flag` classes the next value chosen will be the next highest
+ power-of-two, regardless of the last value seen.
+
+.. versionadded:: 3.6 ``_missing_``, ``_order_``, ``_generate_next_value_``
+.. versionadded:: 3.7 ``_ignore_``
+
+To help keep Python 2 / Python 3 code in sync an :attr:`_order_` attribute can
+be provided. It will be checked against the actual order of the enumeration
+and raise an error if the two do not match::
+
+ >>> class Color(Enum):
+ ... _order_ = 'RED GREEN BLUE'
+ ... RED = 1
+ ... BLUE = 3
+ ... GREEN = 2
+ ...
+ Traceback (most recent call last):
+ ...
+ TypeError: member order does not match _order_:
+ ['RED', 'BLUE', 'GREEN']
+ ['RED', 'GREEN', 'BLUE']
+
+.. note::
+
+ In Python 2 code the :attr:`_order_` attribute is necessary as definition
+ order is lost before it can be recorded.
+
+
+_Private__names
+"""""""""""""""
+
+Private names are not converted to enum members, but remain normal attributes.
+
+.. versionchanged:: 3.10
+
+
+``Enum`` member type
+""""""""""""""""""""
+
+Enum members are instances of their enum class, and are normally accessed as
+``EnumClass.member``. In Python versions ``3.5`` to ``3.9`` you could access
+members from other members -- this practice was discouraged, and in ``3.12``
+:class:`Enum` will return to not allowing it, while in ``3.10`` and ``3.11``
+it will raise a :exc:`DeprecationWarning`::
+
+ >>> class FieldTypes(Enum):
+ ... name = 0
+ ... value = 1
+ ... size = 2
+ ...
+ >>> FieldTypes.value.size # doctest: +SKIP
+ DeprecationWarning: accessing one member from another is not supported,
+ and will be disabled in 3.12
+ <FieldTypes.size: 2>
+
+.. versionchanged:: 3.5
+.. versionchanged:: 3.10
+
+
+Creating members that are mixed with other data types
+"""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+When subclassing other data types, such as :class:`int` or :class:`str`, with
+an :class:`Enum`, all values after the `=` are passed to that data type's
+constructor. For example::
+
+ >>> class MyEnum(IntEnum):
+ ... example = '11', 16 # '11' will be interpreted as a hexadecimal
+ ... # number
+ >>> MyEnum.example.value
+ 17
+
+
+Boolean value of ``Enum`` classes and members
+"""""""""""""""""""""""""""""""""""""""""""""
+
+Enum classes that are mixed with non-:class:`Enum` types (such as
+:class:`int`, :class:`str`, etc.) are evaluated according to the mixed-in
+type's rules; otherwise, all members evaluate as :data:`True`. To make your
+own enum's boolean evaluation depend on the member's value add the following to
+your class::
+
+ def __bool__(self):
+ return bool(self.value)
+
+Plain :class:`Enum` classes always evaluate as :data:`True`.
+
+
+``Enum`` classes with methods
+"""""""""""""""""""""""""""""
+
+If you give your enum subclass extra methods, like the `Planet`_
+class above, those methods will show up in a :func:`dir` of the member,
+but not of the class::
+
+ >>> dir(Planet)
+ ['EARTH', 'JUPITER', 'MARS', 'MERCURY', 'NEPTUNE', 'SATURN', 'URANUS', 'VENUS', '__class__', '__doc__', '__members__', '__module__']
+ >>> dir(Planet.EARTH)
+ ['__class__', '__doc__', '__module__', 'mass', 'name', 'radius', 'surface_gravity', 'value']
+
+
+Combining members of ``Flag``
+"""""""""""""""""""""""""""""
+
+Iterating over a combination of :class:`Flag` members will only return the members that
+are comprised of a single bit::
+
+ >>> class Color(Flag):
+ ... RED = auto()
+ ... GREEN = auto()
+ ... BLUE = auto()
+ ... MAGENTA = RED | BLUE
+ ... YELLOW = RED | GREEN
+ ... CYAN = GREEN | BLUE
+ ...
+ >>> Color(3) # named combination
+ Color.YELLOW
+ >>> Color(7) # not named combination
+ Color.RED|Color.GREEN|Color.BLUE
+
+``StrEnum`` and :meth:`str.__str__`
+"""""""""""""""""""""""""""""""""""
+
+An important difference between :class:`StrEnum` and other Enums is the
+:meth:`__str__` method; because :class:`StrEnum` members are strings, some
+parts of Python will read the string data directly, while others will call
+:meth:`str()`. To make those two operations have the same result,
+:meth:`StrEnum.__str__` will be the same as :meth:`str.__str__` so that
+``str(StrEnum.member) == StrEnum.member`` is true.
+
+``Flag`` and ``IntFlag`` minutia
+""""""""""""""""""""""""""""""""
+
+Using the following snippet for our examples::
+
+ >>> class Color(IntFlag):
+ ... BLACK = 0
+ ... RED = 1
+ ... GREEN = 2
+ ... BLUE = 4
+ ... PURPLE = RED | BLUE
+ ... WHITE = RED | GREEN | BLUE
+ ...
+
+the following are true:
+
+- single-bit flags are canonical
+- multi-bit and zero-bit flags are aliases
+- only canonical flags are returned during iteration::
+
+ >>> list(Color.WHITE)
+ [Color.RED, Color.GREEN, Color.BLUE]
+
+- negating a flag or flag set returns a new flag/flag set with the
+ corresponding positive integer value::
+
+ >>> Color.BLUE
+ Color.BLUE
+
+ >>> ~Color.BLUE
+ Color.RED|Color.GREEN
+
+- names of pseudo-flags are constructed from their members' names::
+
+ >>> (Color.RED | Color.GREEN).name
+ 'RED|GREEN'
+
+- multi-bit flags, aka aliases, can be returned from operations::
+
+ >>> Color.RED | Color.BLUE
+ Color.PURPLE
+
+ >>> Color(7) # or Color(-1)
+ Color.WHITE
+
+ >>> Color(0)
+ Color.BLACK
+
+- membership / containment checking has changed slightly -- zero valued flags
+ are never considered to be contained::
+
+ >>> Color.BLACK in Color.WHITE
+ False
+
+ otherwise, if all bits of one flag are in the other flag, True is returned::
+
+ >>> Color.PURPLE in Color.WHITE
+ True
+
+There is a new boundary mechanism that controls how out-of-range / invalid
+bits are handled: ``STRICT``, ``CONFORM``, ``EJECT``, and ``KEEP``:
+
+ * STRICT --> raises an exception when presented with invalid values
+ * CONFORM --> discards any invalid bits
+ * EJECT --> lose Flag status and become a normal int with the given value
+ * KEEP --> keep the extra bits
+ - keeps Flag status and extra bits
+ - extra bits do not show up in iteration
+ - extra bits do show up in repr() and str()
+
+The default for Flag is ``STRICT``, the default for ``IntFlag`` is ``EJECT``,
+and the default for ``_convert_`` is ``KEEP`` (see ``ssl.Options`` for an
+example of when ``KEEP`` is needed).
+
+
+.. _enum-class-differences:
+
+How are Enums different?
+------------------------
+
+Enums have a custom metaclass that affects many aspects of both derived :class:`Enum`
+classes and their instances (members).
+
+
+Enum Classes
+^^^^^^^^^^^^
+
+The :class:`EnumType` metaclass is responsible for providing the
+:meth:`__contains__`, :meth:`__dir__`, :meth:`__iter__` and other methods that
+allow one to do things with an :class:`Enum` class that fail on a typical
+class, such as `list(Color)` or `some_enum_var in Color`. :class:`EnumType` is
+responsible for ensuring that various other methods on the final :class:`Enum`
+class are correct (such as :meth:`__new__`, :meth:`__getnewargs__`,
+:meth:`__str__` and :meth:`__repr__`).
+
+
+Enum Members (aka instances)
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+The most interesting thing about enum members is that they are singletons.
+:class:`EnumType` creates them all while it is creating the enum class itself,
+and then puts a custom :meth:`__new__` in place to ensure that no new ones are
+ever instantiated by returning only the existing member instances.
+
+
+.. _enum-cookbook:
+
+
+While :class:`Enum`, :class:`IntEnum`, :class:`StrEnum`, :class:`Flag`, and
+:class:`IntFlag` are expected to cover the majority of use-cases, they cannot
+cover them all. Here are recipes for some different types of enumerations
+that can be used directly, or as examples for creating one's own.
+
+
+Omitting values
+^^^^^^^^^^^^^^^
+
+In many use-cases one doesn't care what the actual value of an enumeration
+is. There are several ways to define this type of simple enumeration:
+
+- use instances of :class:`auto` for the value
+- use instances of :class:`object` as the value
+- use a descriptive string as the value
+- use a tuple as the value and a custom :meth:`__new__` to replace the
+ tuple with an :class:`int` value
+
+Using any of these methods signifies to the user that these values are not
+important, and also enables one to add, remove, or reorder members without
+having to renumber the remaining members.
+
+
+Using :class:`auto`
+"""""""""""""""""""
+
+Using :class:`auto` would look like::
+
+ >>> class Color(Enum):
+ ... RED = auto()
+ ... BLUE = auto()
+ ... GREEN = auto()
+ ...
+ >>> Color.GREEN
+ <Color.GREEN>
+
+
+Using :class:`object`
+"""""""""""""""""""""
+
+Using :class:`object` would look like::
+
+ >>> class Color(Enum):
+ ... RED = object()
+ ... GREEN = object()
+ ... BLUE = object()
+ ...
+ >>> Color.GREEN
+ <Color.GREEN>
+
+
+Using a descriptive string
+""""""""""""""""""""""""""
+
+Using a string as the value would look like::
+
+ >>> class Color(Enum):
+ ... RED = 'stop'
+ ... GREEN = 'go'
+ ... BLUE = 'too fast!'
+ ...
+ >>> Color.GREEN
+ <Color.GREEN>
+ >>> Color.GREEN.value
+ 'go'
+
+
+Using a custom :meth:`__new__`
+""""""""""""""""""""""""""""""
+
+Using an auto-numbering :meth:`__new__` would look like::
+
+ >>> class AutoNumber(Enum):
+ ... def __new__(cls):
+ ... value = len(cls.__members__) + 1
+ ... obj = object.__new__(cls)
+ ... obj._value_ = value
+ ... return obj
+ ...
+ >>> class Color(AutoNumber):
+ ... RED = ()
+ ... GREEN = ()
+ ... BLUE = ()
+ ...
+ >>> Color.GREEN
+ <Color.GREEN>
+ >>> Color.GREEN.value
+ 2
+
+To make a more general purpose ``AutoNumber``, add ``*args`` to the signature::
+
+ >>> class AutoNumber(Enum):
+ ... def __new__(cls, *args): # this is the only change from above
+ ... value = len(cls.__members__) + 1
+ ... obj = object.__new__(cls)
+ ... obj._value_ = value
+ ... return obj
+ ...
+
+Then when you inherit from ``AutoNumber`` you can write your own ``__init__``
+to handle any extra arguments::
+
+ >>> class Swatch(AutoNumber):
+ ... def __init__(self, pantone='unknown'):
+ ... self.pantone = pantone
+ ... AUBURN = '3497'
+ ... SEA_GREEN = '1246'
+ ... BLEACHED_CORAL = () # New color, no Pantone code yet!
+ ...
+ >>> Swatch.SEA_GREEN
+ <Swatch.SEA_GREEN>
+ >>> Swatch.SEA_GREEN.pantone
+ '1246'
+ >>> Swatch.BLEACHED_CORAL.pantone
+ 'unknown'
+
+.. note::
+
+ The :meth:`__new__` method, if defined, is used during creation of the Enum
+ members; it is then replaced by Enum's :meth:`__new__` which is used after
+ class creation for lookup of existing members.
+
+
+OrderedEnum
+^^^^^^^^^^^
+
+An ordered enumeration that is not based on :class:`IntEnum` and so maintains
+the normal :class:`Enum` invariants (such as not being comparable to other
+enumerations)::
+
+ >>> class OrderedEnum(Enum):
+ ... def __ge__(self, other):
+ ... if self.__class__ is other.__class__:
+ ... return self.value >= other.value
+ ... return NotImplemented
+ ... def __gt__(self, other):
+ ... if self.__class__ is other.__class__:
+ ... return self.value > other.value
+ ... return NotImplemented
+ ... def __le__(self, other):
+ ... if self.__class__ is other.__class__:
+ ... return self.value <= other.value
+ ... return NotImplemented
+ ... def __lt__(self, other):
+ ... if self.__class__ is other.__class__:
+ ... return self.value < other.value
+ ... return NotImplemented
+ ...
+ >>> class Grade(OrderedEnum):
+ ... A = 5
+ ... B = 4
+ ... C = 3
+ ... D = 2
+ ... F = 1
+ ...
+ >>> Grade.C < Grade.A
+ True
+
+
+DuplicateFreeEnum
+^^^^^^^^^^^^^^^^^
+
+Raises an error if a duplicate member name is found instead of creating an
+alias::
+
+ >>> class DuplicateFreeEnum(Enum):
+ ... def __init__(self, *args):
+ ... cls = self.__class__
+ ... if any(self.value == e.value for e in cls):
+ ... a = self.name
+ ... e = cls(self.value).name
+ ... raise ValueError(
+ ... "aliases not allowed in DuplicateFreeEnum: %r --> %r"
+ ... % (a, e))
+ ...
+ >>> class Color(DuplicateFreeEnum):
+ ... RED = 1
+ ... GREEN = 2
+ ... BLUE = 3
+ ... GRENE = 2
+ ...
+ Traceback (most recent call last):
+ ...
+ ValueError: aliases not allowed in DuplicateFreeEnum: 'GRENE' --> 'GREEN'
+
+.. note::
+
+ This is a useful example for subclassing Enum to add or change other
+ behaviors as well as disallowing aliases. If the only desired change is
+ disallowing aliases, the :func:`unique` decorator can be used instead.
+
+
+Planet
+^^^^^^
+
+If :meth:`__new__` or :meth:`__init__` is defined the value of the enum member
+will be passed to those methods::
+
+ >>> class Planet(Enum):
+ ... MERCURY = (3.303e+23, 2.4397e6)
+ ... VENUS = (4.869e+24, 6.0518e6)
+ ... EARTH = (5.976e+24, 6.37814e6)
+ ... MARS = (6.421e+23, 3.3972e6)
+ ... JUPITER = (1.9e+27, 7.1492e7)
+ ... SATURN = (5.688e+26, 6.0268e7)
+ ... URANUS = (8.686e+25, 2.5559e7)
+ ... NEPTUNE = (1.024e+26, 2.4746e7)
+ ... def __init__(self, mass, radius):
+ ... self.mass = mass # in kilograms
+ ... self.radius = radius # in meters
+ ... @property
+ ... def surface_gravity(self):
+ ... # universal gravitational constant (m3 kg-1 s-2)
+ ... G = 6.67300E-11
+ ... return G * self.mass / (self.radius * self.radius)
+ ...
+ >>> Planet.EARTH.value
+ (5.976e+24, 6378140.0)
+ >>> Planet.EARTH.surface_gravity
+ 9.802652743337129
+
+.. _enum-time-period:
+
+TimePeriod
+^^^^^^^^^^
+
+An example to show the :attr:`_ignore_` attribute in use::
+
+ >>> from datetime import timedelta
+ >>> class Period(timedelta, Enum):
+ ... "different lengths of time"
+ ... _ignore_ = 'Period i'
+ ... Period = vars()
+ ... for i in range(367):
+ ... Period['day_%d' % i] = i
+ ...
+ >>> list(Period)[:2]
+ [Period.day_0, Period.day_1]
+ >>> list(Period)[-2:]
+ [Period.day_365, Period.day_366]
+
+
+Conforming input to Flag
+^^^^^^^^^^^^^^^^^^^^^^^^
+
+Creating a :class:`Flag` enum that is more resilient out-of-bounds results to
+mathematical operations, you can use the :attr:`FlagBoundary.CONFORM` setting::
+
+ >>> from enum import Flag, CONFORM, auto
+ >>> class Weekday(Flag, boundary=CONFORM):
+ ... MONDAY = auto()
+ ... TUESDAY = auto()
+ ... WEDNESDAY = auto()
+ ... THURSDAY = auto()
+ ... FRIDAY = auto()
+ ... SATURDAY = auto()
+ ... SUNDAY = auto()
+ >>> today = Weekday.TUESDAY
+ >>> Weekday(today + 22) # what day is three weeks from tomorrow?
+ >>> Weekday.WEDNESDAY
+
+
+.. _enumtype-examples:
+
+Subclassing EnumType
+--------------------
+
+While most enum needs can be met by customizing :class:`Enum` subclasses,
+either with class decorators or custom functions, :class:`EnumType` can be
+subclassed to provide a different Enum experience.
+
diff --git a/Doc/howto/index.rst b/Doc/howto/index.rst
index 593341cc2b8a1..e0dacd224d82e 100644
--- a/Doc/howto/index.rst
+++ b/Doc/howto/index.rst
@@ -17,6 +17,7 @@ Currently, the HOWTOs are:
cporting.rst
curses.rst
descriptor.rst
+ enum.rst
functional.rst
logging.rst
logging-cookbook.rst
diff --git a/Doc/library/enum.rst b/Doc/library/enum.rst
index 73b77cbc671cd..3a6b2aa2c50cd 100644
--- a/Doc/library/enum.rst
+++ b/Doc/library/enum.rst
@@ -13,1368 +13,612 @@
**Source code:** :source:`Lib/enum.py`
-----------------
-
-An enumeration is a set of symbolic names (members) bound to unique,
-constant values. Within an enumeration, the members can be compared
-by identity, and the enumeration itself can be iterated over.
-
-.. note:: Case of Enum Members
+.. sidebar:: Important
- Because Enums are used to represent constants we recommend using
- UPPER_CASE names for enum members, and will be using that style
- in our examples.
+ This page contains the API reference information. For tutorial
+ information and discussion of more advanced topics, see
+ * :ref:`Basic Tutorial <enum-basic-tutorial>`
+ * :ref:`Advanced Tutorial <enum-advanced-tutorial>`
+ * :ref:`Enum Cookbook <enum-cookbook>`
-Module Contents
----------------
-
-This module defines four enumeration classes that can be used to define unique
-sets of names and values: :class:`Enum`, :class:`IntEnum`, :class:`Flag`, and
-:class:`IntFlag`. It also defines one decorator, :func:`unique`, and one
-helper, :class:`auto`.
-
-.. class:: Enum
-
- Base class for creating enumerated constants. See section
- `Functional API`_ for an alternate construction syntax.
-
-.. class:: IntEnum
-
- Base class for creating enumerated constants that are also
- subclasses of :class:`int`.
-
-.. class:: StrEnum
-
- Base class for creating enumerated constants that are also
- subclasses of :class:`str`.
-
-.. class:: IntFlag
-
- Base class for creating enumerated constants that can be combined using
- the bitwise operators without losing their :class:`IntFlag` membership.
- :class:`IntFlag` members are also subclasses of :class:`int`.
-
-.. class:: Flag
-
- Base class for creating enumerated constants that can be combined using
- the bitwise operations without losing their :class:`Flag` membership.
-
-.. function:: unique
- :noindex:
-
- Enum class decorator that ensures only one name is bound to any one value.
-
-.. class:: auto
-
- Instances are replaced with an appropriate value for Enum members.
- :class:`StrEnum` defaults to the lower-cased version of the member name,
- while other Enums default to 1 and increase from there.
-
-.. versionadded:: 3.6 ``Flag``, ``IntFlag``, ``auto``
-.. versionadded:: 3.10 ``StrEnum``
-
-Creating an Enum
----------------
-Enumerations are created using the :keyword:`class` syntax, which makes them
-easy to read and write. An alternative creation method is described in
-`Functional API`_. To define an enumeration, subclass :class:`Enum` as
-follows::
-
- >>> from enum import Enum
- >>> class Color(Enum):
- ... RED = 1
- ... GREEN = 2
- ... BLUE = 3
- ...
-
-.. note:: Enum member values
-
- Member values can be anything: :class:`int`, :class:`str`, etc.. If
- the exact value is unimportant you may use :class:`auto` instances and an
- appropriate value will be chosen for you. Care must be taken if you mix
- :class:`auto` with other values.
+An enumeration:
-.. note:: Nomenclature
-
- - The class :class:`Color` is an *enumeration* (or *enum*)
- - The attributes :attr:`Color.RED`, :attr:`Color.GREEN`, etc., are
- *enumeration members* (or *enum members*) and are functionally constants.
- - The enum members have *names* and *values* (the name of
- :attr:`Color.RED` is ``RED``, the value of :attr:`Color.BLUE` is
- ``3``, etc.)
-
-.. note::
-
- Even though we use the :keyword:`class` syntax to create Enums, Enums
- are not normal Python classes. See `How are Enums different?`_ for
- more details.
-
-Enumeration members have human readable string representations::
-
- >>> print(Color.RED)
- Color.RED
-
-...while their ``repr`` has more information::
-
- >>> print(repr(Color.RED))
- <Color.RED: 1>
-
-The *type* of an enumeration member is the enumeration it belongs to::
-
- >>> type(Color.RED)
- <enum 'Color'>
- >>> isinstance(Color.GREEN, Color)
- True
-
-Enum members also have a property that contains just their item name::
-
- >>> print(Color.RED.name)
- RED
-
-Enumerations support iteration, in definition order::
-
- >>> class Shake(Enum):
- ... VANILLA = 7
- ... CHOCOLATE = 4
- ... COOKIES = 9
- ... MINT = 3
- ...
- >>> for shake in Shake:
- ... print(shake)
- ...
- Shake.VANILLA
- Shake.CHOCOLATE
- Shake.COOKIES
- Shake.MINT
-
-Enumeration members are hashable, so they can be used in dictionaries and sets::
-
- >>> apples = {}
- >>> apples[Color.RED] = 'red delicious'
- >>> apples[Color.GREEN] = 'granny smith'
- >>> apples == {Color.RED: 'red delicious', Color.GREEN: 'granny smith'}
- True
+* is a set of symbolic names (members) bound to unique values
+* can be iterated over to return its members in definition order
+* uses :meth:`call` syntax to return members by value
+* uses :meth:`index` syntax to return members by name
+Enumerations are created either by using the :keyword:`class` syntax, or by
+using function-call syntax::
-Programmatic access to enumeration members and their attributes
----------------------------------------------------------------
+ >>> from enum import Enum
-Sometimes it's useful to access members in enumerations programmatically (i.e.
-situations where ``Color.RED`` won't do because the exact color is not known
-at program-writing time). ``Enum`` allows such access::
+ >>> # class syntax
+ >>> class Color(Enum):
+ ... RED = 1
+ ... GREEN = 2
+ ... BLUE = 3
- >>> Color(1)
- <Color.RED: 1>
- >>> Color(3)
- <Color.BLUE: 3>
+ >>> # functional syntax
+ >>> Color = Enum('Color', ['RED', 'GREEN', 'BLUE'])
-If you want to access enum members by *name*, use item access::
+Even though we can use the :keyword:`class` syntax to create Enums, Enums
+are not normal Python classes. See
+:ref:`How are Enums different? <enum-class-differences>` for more details.
- >>> Color['RED']
- <Color.RED: 1>
- >>> Color['GREEN']
- <Color.GREEN: 2>
-
-If you have an enum member and need its :attr:`name` or :attr:`value`::
-
- >>> member = Color.RED
- >>> member.name
- 'RED'
- >>> member.value
- 1
-
-
-Duplicating enum members and values
------------------------------------
-
-Having two enum members with the same name is invalid::
-
- >>> class Shape(Enum):
- ... SQUARE = 2
- ... SQUARE = 3
- ...
- Traceback (most recent call last):
- ...
- TypeError: 'SQUARE' already defined as: 2
-
-However, two enum members are allowed to have the same value. Given two members
-A and B with the same value (and A defined first), B is an alias to A. By-value
-lookup of the value of A and B will return A. By-name lookup of B will also
-return A::
-
- >>> class Shape(Enum):
- ... SQUARE = 2
- ... DIAMOND = 1
- ... CIRCLE = 3
- ... ALIAS_FOR_SQUARE = 2
- ...
- >>> Shape.SQUARE
- <Shape.SQUARE: 2>
- >>> Shape.ALIAS_FOR_SQUARE
- <Shape.SQUARE: 2>
- >>> Shape(2)
- <Shape.SQUARE: 2>
-
-.. note::
-
- Attempting to create a member with the same name as an already
- defined attribute (another member, a method, etc.) or attempting to create
- an attribute with the same name as a member is not allowed.
-
-
-Ensuring unique enumeration values
-----------------------------------
-
-By default, enumerations allow multiple names as aliases for the same value.
-When this behavior isn't desired, the following decorator can be used to
-ensure each value is used only once in the enumeration:
-
-.. decorator:: unique
-
-A :keyword:`class` decorator specifically for enumerations. It searches an
-enumeration's :attr:`__members__` gathering any aliases it finds; if any are
-found :exc:`ValueError` is raised with the details::
-
- >>> from enum import Enum, unique
- >>> @unique
- ... class Mistake(Enum):
- ... ONE = 1
- ... TWO = 2
- ... THREE = 3
- ... FOUR = 3
- ...
- Traceback (most recent call last):
- ...
- ValueError: duplicate values found in <enum 'Mistake'>: FOUR -> THREE
-
-
-Using automatic values
-----------------------
-
-If the exact value is unimportant you can use :class:`auto`::
-
- >>> from enum import Enum, auto
- >>> class Color(Enum):
- ... RED = auto()
- ... BLUE = auto()
- ... GREEN = auto()
- ...
- >>> list(Color)
- [<Color.RED: 1>, <Color.BLUE: 2>, <Color.GREEN: 3>]
-
-The values are chosen by :func:`_generate_next_value_`, which can be
-overridden::
-
- >>> class AutoName(Enum):
- ... def _generate_next_value_(name, start, count, last_values):
- ... return name
- ...
- >>> class Ordinal(AutoName):
- ... NORTH = auto()
- ... SOUTH = auto()
- ... EAST = auto()
- ... WEST = auto()
- ...
- >>> list(Ordinal)
- [<Ordinal.NORTH: 'NORTH'>, <Ordinal.SOUTH: 'SOUTH'>, <Ordinal.EAST: 'EAST'>, <Ordinal.WEST: 'WEST'>]
-
-.. note::
-
- The goal of the default :meth:`_generate_next_value_` method is to provide
- the next :class:`int` in sequence with the last :class:`int` provided, but
- the way it does this is an implementation detail and may change.
-
-.. note::
-
- The :meth:`_generate_next_value_` method must be defined before any members.
-
-Iteration
----------
-
-Iterating over the members of an enum does not provide the aliases::
-
- >>> list(Shape)
- [<Shape.SQUARE: 2>, <Shape.DIAMOND: 1>, <Shape.CIRCLE: 3>]
-
-The special attribute ``__members__`` is a read-only ordered mapping of names
-to members. It includes all names defined in the enumeration, including the
-aliases::
-
- >>> for name, member in Shape.__members__.items():
- ... name, member
- ...
- ('SQUARE', <Shape.SQUARE: 2>)
- ('DIAMOND', <Shape.DIAMOND: 1>)
- ('CIRCLE', <Shape.CIRCLE: 3>)
- ('ALIAS_FOR_SQUARE', <Shape.SQUARE: 2>)
-
-The ``__members__`` attribute can be used for detailed programmatic access to
-the enumeration members. For example, finding all the aliases::
-
- >>> [name for name, member in Shape.__members__.items() if member.name != name]
- ['ALIAS_FOR_SQUARE']
+.. note:: Nomenclature
+ - The class :class:`Color` is an *enumeration* (or *enum*)
+ - The attributes :attr:`Color.RED`, :attr:`Color.GREEN`, etc., are
+ *enumeration members* (or *enum members*) and are functionally constants.
+ - The enum members have *names* and *values* (the name of
+ :attr:`Color.RED` is ``RED``, the value of :attr:`Color.BLUE` is
+ ``3``, etc.)
-Comparisons
------------
-Enumeration members are compared by identity::
+Module Contents
+---------------
- >>> Color.RED is Color.RED
- True
- >>> Color.RED is Color.BLUE
- False
- >>> Color.RED is not Color.BLUE
- True
+ :class:`EnumType`
-Ordered comparisons between enumeration values are *not* supported. Enum
-members are not integers (but see `IntEnum`_ below)::
-
- >>> Color.RED < Color.BLUE
- Traceback (most recent call last):
- File "<stdin>", line 1, in <module>
- TypeError: '<' not supported between instances of 'Color' and 'Color'
-
-Equality comparisons are defined though::
-
- >>> Color.BLUE == Color.RED
- False
- >>> Color.BLUE != Color.RED
- True
- >>> Color.BLUE == Color.BLUE
- True
+ The ``type`` for Enum and its subclasses.
-Comparisons against non-enumeration values will always compare not equal
-(again, :class:`IntEnum` was explicitly designed to behave differently, see
-below)::
+ :class:`Enum`
- >>> Color.BLUE == 2
- False
+ Base class for creating enumerated constants.
+ :class:`IntEnum`
-Allowed members and attributes of enumerations
-----------------------------------------------
+ Base class for creating enumerated constants that are also
+ subclasses of :class:`int`.
-The examples above use integers for enumeration values. Using integers is
-short and handy (and provided by default by the `Functional API`_), but not
-strictly enforced. In the vast majority of use-cases, one doesn't care what
-the actual value of an enumeration is. But if the value *is* important,
-enumerations can have arbitrary values.
+ :class:`StrEnum`
-Enumerations are Python classes, and can have methods and special methods as
-usual. If we have this enumeration::
+ Base class for creating enumerated constants that are also
+ subclasses of :class:`str`.
- >>> class Mood(Enum):
- ... FUNKY = 1
- ... HAPPY = 3
- ...
- ... def describe(self):
- ... # self is the member here
- ... return self.name, self.value
- ...
- ... def __str__(self):
- ... return 'my custom str! {0}'.format(self.value)
- ...
- ... @classmethod
- ... def favorite_mood(cls):
- ... # cls here is the enumeration
- ... return cls.HAPPY
- ...
+ :class:`Flag`
-Then::
+ Base class for creating enumerated constants that can be combined using
+ the bitwise operations without losing their :class:`Flag` membership.
- >>> Mood.favorite_mood()
- <Mood.HAPPY: 3>
- >>> Mood.HAPPY.describe()
- ('HAPPY', 3)
- >>> str(Mood.FUNKY)
- 'my custom str! 1'
-
-The rules for what is allowed are as follows: names that start and end with
-a single underscore are reserved by enum and cannot be used; all other
-attributes defined within an enumeration will become members of this
-enumeration, with the exception of special methods (:meth:`__str__`,
-:meth:`__add__`, etc.), descriptors (methods are also descriptors), and
-variable names listed in :attr:`_ignore_`.
-
-Note: if your enumeration defines :meth:`__new__` and/or :meth:`__init__` then
-any value(s) given to the enum member will be passed into those methods.
-See `Planet`_ for an example.
-
-
-Restricted Enum subclassing
----------------------------
-
-A new :class:`Enum` class must have one base Enum class, up to one concrete
-data type, and as many :class:`object`-based mixin classes as needed. The
-order of these base classes is::
-
- class EnumName([mix-in, ...,] [data-type,] base-enum):
- pass
-
-Also, subclassing an enumeration is allowed only if the enumeration does not define
-any members. So this is forbidden::
-
- >>> class MoreColor(Color):
- ... PINK = 17
- ...
- Traceback (most recent call last):
- ...
- TypeError: MoreColor: cannot extend enumeration 'Color'
-
-But this is allowed::
-
- >>> class Foo(Enum):
- ... def some_behavior(self):
- ... pass
- ...
- >>> class Bar(Foo):
- ... HAPPY = 1
- ... SAD = 2
- ...
-
-Allowing subclassing of enums that define members would lead to a violation of
-some important invariants of types and instances. On the other hand, it makes
-sense to allow sharing some common behavior between a group of enumerations.
-(See `OrderedEnum`_ for an example.)
-
-
-Pickling
---------
-
-Enumerations can be pickled and unpickled::
-
- >>> from test.test_enum import Fruit
- >>> from pickle import dumps, loads
- >>> Fruit.TOMATO is loads(dumps(Fruit.TOMATO))
- True
-
-The usual restrictions for pickling apply: picklable enums must be defined in
-the top level of a module, since unpickling requires them to be importable
-from that module.
+ :class:`IntFlag`
-.. note::
+ Base class for creating enumerated constants that can be combined using
+ the bitwise operators without losing their :class:`IntFlag` membership.
+ :class:`IntFlag` members are also subclasses of :class:`int`.
- With pickle protocol version 4 it is possible to easily pickle enums
- nested in other classes.
+ :class:`FlagBoundary`
-It is possible to modify how Enum members are pickled/unpickled by defining
-:meth:`__reduce_ex__` in the enumeration class.
+ An enumeration with the values ``STRICT``, ``CONFORM``, ``EJECT``, and
+ ``KEEP`` which allows for more fine-grained control over how invalid values
+ are dealt with in an enumeration.
+ :class:`auto`
-Functional API
---------------
+ Instances are replaced with an appropriate value for Enum members.
+ :class:`StrEnum` defaults to the lower-cased version of the member name,
+ while other Enums default to 1 and increase from there.
-The :class:`Enum` class is callable, providing the following functional API::
+ :func:`global_enum`
- >>> Animal = Enum('Animal', 'ANT BEE CAT DOG')
- >>> Animal
- <enum 'Animal'>
- >>> Animal.ANT
- <Animal.ANT: 1>
- >>> Animal.ANT.value
- 1
- >>> list(Animal)
- [<Animal.ANT: 1>, <Animal.BEE: 2>, <Animal.CAT: 3>, <Animal.DOG: 4>]
+ :class:`Enum` class decorator to apply the appropriate global `__repr__`,
+ and export its members into the global name space.
-The semantics of this API resemble :class:`~collections.namedtuple`. The first
-argument of the call to :class:`Enum` is the name of the enumeration.
+ :func:`property`
-The second argument is the *source* of enumeration member names. It can be a
-whitespace-separated string of names, a sequence of names, a sequence of
-2-tuples with key/value pairs, or a mapping (e.g. dictionary) of names to
-values. The last two options enable assigning arbitrary values to
-enumerations; the others auto-assign increasing integers starting with 1 (use
-the ``start`` parameter to specify a different starting value). A
-new class derived from :class:`Enum` is returned. In other words, the above
-assignment to :class:`Animal` is equivalent to::
+ Allows :class:`Enum` members to have attributes without conflicting with
+ other members' names.
- >>> class Animal(Enum):
- ... ANT = 1
- ... BEE = 2
- ... CAT = 3
- ... DOG = 4
- ...
+ :func:`unique`
-The reason for defaulting to ``1`` as the starting number and not ``0`` is
-that ``0`` is ``False`` in a boolean sense, but enum members all evaluate
-to ``True``.
+ Enum class decorator that ensures only one name is bound to any one value.
-Pickling enums created with the functional API can be tricky as frame stack
-implementation details are used to try and figure out which module the
-enumeration is being created in (e.g. it will fail if you use a utility
-function in separate module, and also may not work on IronPython or Jython).
-The solution is to specify the module name explicitly as follows::
- >>> Animal = Enum('Animal', 'ANT BEE CAT DOG', module=__name__)
+.. versionadded:: 3.6 ``Flag``, ``IntFlag``, ``auto``
+.. versionadded:: 3.10 ``StrEnum``
-.. warning::
- If ``module`` is not supplied, and Enum cannot determine what it is,
- the new Enum members will not be unpicklable; to keep errors closer to
- the source, pickling will be disabled.
+Data Types
+----------
-The new pickle protocol 4 also, in some circumstances, relies on
-:attr:`~definition.__qualname__` being set to the location where pickle will be able
-to find the class. For example, if the class was made available in class
-SomeData in the global scope::
- >>> Animal = Enum('Animal', 'ANT BEE CAT DOG', qualname='SomeData.Animal')
+.. class:: EnumType
-The complete signature is::
+ *EnumType* is the :term:`metaclass` for *enum* enumerations. It is possible
+ to subclass *EnumType* -- see :ref:`Subclassing EnumType <enumtype-examples>`
+ for details.
- Enum(value='NewEnumName', names=<...>, *, module='...', qualname='...', type=<mixed-in class>, start=1)
+ .. method:: EnumType.__contains__(cls, member)
-:value: What the new Enum class will record as its name.
+ Returns ``True`` if member belongs to the ``cls``::
-:names: The Enum members. This can be a whitespace or comma separated string
- (values will start at 1 unless otherwise specified)::
+ >>> some_var = Color.RED
+ >>> some_var in Color
+ True
- 'RED GREEN BLUE' | 'RED,GREEN,BLUE' | 'RED, GREEN, BLUE'
+ .. method:: EnumType.__dir__(cls)
- or an iterator of names::
+ Returns ``['__class__', '__doc__', '__members__', '__module__']`` and the
+ names of the members in *cls*::
- ['RED', 'GREEN', 'BLUE']
+ >>> dir(Color)
+ ['BLUE', 'GREEN', 'RED', '__class__', '__doc__', '__members__', '__module__']
- or an iterator of (name, value) pairs::
+ .. method:: EnumType.__getattr__(cls, name)
- [('CYAN', 4), ('MAGENTA', 5), ('YELLOW', 6)]
+ Returns the Enum member in *cls* matching *name*, or raises an :exc:`AttributeError`::
- or a mapping::
+ >>> Color.GREEN
+ Color.GREEN
- {'CHARTREUSE': 7, 'SEA_GREEN': 11, 'ROSEMARY': 42}
+ .. method:: EnumType.__getitem__(cls, name)
-:module: name of module where new Enum class can be found.
+ Returns the Enum member in *cls* matching *name*, or raises an :exc:`KeyError`::
-:qualname: where in module new Enum class can be found.
+ >>> Color['BLUE']
+ Color.BLUE
-:type: type to mix in to new Enum class.
+ .. method:: EnumType.__iter__(cls)
-:start: number to start counting at if only names are passed in.
+ Returns each member in *cls* in definition order::
-.. versionchanged:: 3.5
- The *start* parameter was added.
+ >>> list(Color)
+ [Color.RED, Color.GREEN, Color.BLUE]
+ .. method:: EnumType.__len__(cls)
-Derived Enumerations
---------------------
+ Returns the number of member in *cls*::
-IntEnum
-^^^^^^^
+ >>> len(Color)
+ 3
-The first variation of :class:`Enum` that is provided is also a subclass of
-:class:`int`. Members of an :class:`IntEnum` can be compared to integers;
-by extension, integer enumerations of different types can also be compared
-to each other::
+ .. method:: EnumType.__reversed__(cls)
- >>> from enum import IntEnum
- >>> class Shape(IntEnum):
- ... CIRCLE = 1
- ... SQUARE = 2
- ...
- >>> class Request(IntEnum):
- ... POST = 1
- ... GET = 2
- ...
- >>> Shape == 1
- False
- >>> Shape.CIRCLE == 1
- True
- >>> Shape.CIRCLE == Request.POST
- True
+ Returns each member in *cls* in reverse definition order::
-However, they still can't be compared to standard :class:`Enum` enumerations::
+ >>> list(reversed(Color))
+ [Color.BLUE, Color.GREEN, Color.RED]
- >>> class Shape(IntEnum):
- ... CIRCLE = 1
- ... SQUARE = 2
- ...
- >>> class Color(Enum):
- ... RED = 1
- ... GREEN = 2
- ...
- >>> Shape.CIRCLE == Color.RED
- False
-:class:`IntEnum` values behave like integers in other ways you'd expect::
+.. class:: Enum
- >>> int(Shape.CIRCLE)
- 1
- >>> ['a', 'b', 'c'][Shape.CIRCLE]
- 'b'
- >>> [i for i in range(Shape.SQUARE)]
- [0, 1]
+ *Enum* is the base class for all *enum* enumerations.
+ .. attribute:: Enum.name
-StrEnum
-^^^^^^^
+ The name used to define the ``Enum`` member::
-The second variation of :class:`Enum` that is provided is also a subclass of
-:class:`str`. Members of a :class:`StrEnum` can be compared to strings;
-by extension, string enumerations of different types can also be compared
-to each other. :class:`StrEnum` exists to help avoid the problem of getting
-an incorrect member::
+ >>> Color.BLUE.name
+ 'BLUE'
- >>> from enum import StrEnum
- >>> class Directions(StrEnum):
- ... NORTH = 'north', # notice the trailing comma
- ... SOUTH = 'south'
+ .. attribute:: Enum.value
-Before :class:`StrEnum`, ``Directions.NORTH`` would have been the :class:`tuple`
-``('north',)``.
+ The value given to the ``Enum`` member::
-.. note::
+ >>> Color.RED.value
+ 1
- Unlike other Enum's, ``str(StrEnum.member)`` will return the value of the
- member instead of the usual ``"EnumClass.member"``.
+ .. note:: Enum member values
-.. versionadded:: 3.10
+ Member values can be anything: :class:`int`, :class:`str`, etc.. If
+ the exact value is unimportant you may use :class:`auto` instances and an
+ appropriate value will be chosen for you. Care must be taken if you mix
+ :class:`auto` with other values.
+ .. attribute:: Enum._ignore_
-IntFlag
-^^^^^^^
+ ``_ignore_`` is only used during creation and is removed from the
+ enumeration once that is complete.
-The next variation of :class:`Enum` provided, :class:`IntFlag`, is also based
-on :class:`int`. The difference being :class:`IntFlag` members can be combined
-using the bitwise operators (&, \|, ^, ~) and the result is still an
-:class:`IntFlag` member, if possible. However, as the name implies, :class:`IntFlag`
-members also subclass :class:`int` and can be used wherever an :class:`int` is
-used.
+ ``_ignore_`` is a list of names that will not become members, and whose
+ names will also be removed from the completed enumeration. See
+ :ref:`TimePeriod <enum-time-period>` for an example.
-.. note::
+ .. method:: Enum.__call__(cls, value, names=None, \*, module=None, qualname=None, type=None, start=1, boundary=None)
- Any operation on an :class:`IntFlag` member besides the bit-wise operations will
- lose the :class:`IntFlag` membership.
+ This method is called in two different ways:
-.. note::
+ * to look up an existing member:
- Bit-wise operations that result in invalid :class:`IntFlag` values will lose the
- :class:`IntFlag` membership.
-
-.. versionadded:: 3.6
-.. versionchanged:: 3.10
-
-Sample :class:`IntFlag` class::
-
- >>> from enum import IntFlag
- >>> class Perm(IntFlag):
- ... R = 4
- ... W = 2
- ... X = 1
- ...
- >>> Perm.R | Perm.W
- <Perm.R|W: 6>
- >>> Perm.R + Perm.W
- 6
- >>> RW = Perm.R | Perm.W
- >>> Perm.R in RW
- True
-
-It is also possible to name the combinations::
-
- >>> class Perm(IntFlag):
- ... R = 4
- ... W = 2
- ... X = 1
- ... RWX = 7
- >>> Perm.RWX
- <Perm.RWX: 7>
- >>> ~Perm.RWX
- <Perm: 0>
- >>> Perm(7)
- <Perm.RWX: 7>
+ :cls: The enum class being called.
+ :value: The value to lookup.
+
+ * to use the ``cls`` enum to create a new enum:
+
+ :cls: The enum class being called.
+ :value: The name of the new Enum to create.
+ :names: The names/values of the members for the new Enum.
+ :module: The name of the module the new Enum is created in.
+ :qualname: The actual location in the module where this Enum can be found.
+ :type: A mix-in type for the new Enum.
+ :start: The first integer value for the Enum (used by :class:`auto`)
+ :boundary: How to handle out-of-range values from bit operations (:class:`Flag` only)
+
+ .. method:: Enum.__dir__(self)
+
+ Returns ``['__class__', '__doc__', '__module__', 'name', 'value']`` and
+ any public methods defined on *self.__class__*::
+
+ >>> from datetime import date
+ >>> class Weekday(Enum):
+ ... MONDAY = 1
+ ... TUESDAY = 2
+ ... WEDNESDAY = 3
+ ... THURSDAY = 4
+ ... FRIDAY = 5
+ ... SATURDAY = 6
+ ... SUNDAY = 7
+ ... @classmethod
+ ... def today(cls):
+ ... print('today is %s' % cls(date.today.isoweekday).naem)
+ >>> dir(Weekday.SATURDAY)
+ ['__class__', '__doc__', '__module__', 'name', 'today', 'value']
+
+ .. method:: Enum._generate_next_value_(name, start, count, last_values)
+
+ :name: The name of the member being defined (e.g. 'RED').
+ :start: The start value for the Enum; the default is 1.
+ :count: The number of members currently defined, not including this one.
+ :last_values: A list of the previous values.
+
+ A *staticmethod* that is used to determine the next value returned by
+ :class:`auto`::
+
+ >>> from enum import auto
+ >>> class PowersOfThree(Enum):
+ ... @staticmethod
+ ... def _generate_next_value_(name, start, count, last_values):
+ ... return (count + 1) * 3
+ ... FIRST = auto()
+ ... SECOND = auto()
+ >>> PowersOfThree.SECOND.value
+ 6
+
+ .. method:: Enum._missing_(cls, value)
+
+ A *classmethod* for looking up values not found in *cls*. By default it
+ does nothing, but can be overridden to implement custom search behavior::
+
+ >>> from enum import StrEnum
+ >>> class Build(StrEnum):
+ ... DEBUG = auto()
+ ... OPTIMIZED = auto()
+ ... @classmethod
+ ... def _missing_(cls, value):
+ ... value = value.lower()
+ ... for member in cls:
+ ... if member.value == value:
+ ... return member
+ ... return None
+ >>> Build.DEBUG.value
+ 'debug'
+ >>> Build('deBUG')
+ Build.DEBUG
+
+ .. method:: Enum.__repr__(self)
+
+ Returns the string used for *repr()* calls. By default, returns the
+ *Enum* name and the member name, but can be overridden::
+
+ >>> class OldStyle(Enum):
+ ... RETRO = auto()
+ ... OLD_SCHOOl = auto()
+ ... YESTERYEAR = auto()
+ ... def __repr__(self):
+ ... cls_name = self.__class__.__name__
+ ... return f'<{cls_name}.{self.name}: {self.value}>'
+ >>> OldStyle.RETRO
+ <OldStyle.RETRO: 1>
+
+ .. method:: Enum.__str__(self)
+
+ Returns the string used for *str()* calls. By default, returns the
+ member name, but can be overridden::
+
+ >>> class OldStyle(Enum):
+ ... RETRO = auto()
+ ... OLD_SCHOOl = auto()
+ ... YESTERYEAR = auto()
+ ... def __str__(self):
+ ... cls_name = self.__class__.__name__
+ ... return f'{cls_name}.{self.name}'
+ >>> OldStyle.RETRO
+ OldStyle.RETRO
.. note::
- Named combinations are considered aliases. Aliases do not show up during
- iteration, but can be returned from by-value lookups.
-
-.. versionchanged:: 3.10
-
-Another important difference between :class:`IntFlag` and :class:`Enum` is that
-if no flags are set (the value is 0), its boolean evaluation is :data:`False`::
-
- >>> Perm.R & Perm.X
- <Perm: 0>
- >>> bool(Perm.R & Perm.X)
- False
+ Using :class:`auto` with :class:`Enum` results in integers of increasing value,
+ starting with ``1``.
-Because :class:`IntFlag` members are also subclasses of :class:`int` they can
-be combined with them (but may lose :class:`IntFlag` membership::
- >>> Perm.X | 4
- <Perm.R|X: 5>
+.. class:: IntEnum
- >>> Perm.X | 8
- 9
+ *IntEnum* is the same as *Enum*, but its members are also integers and can be
+ used anywhere that an integer can be used. If any integer operation is performed
+ with an *IntEnum* member, the resulting value loses its enumeration status.
+
+ >>> from enum import IntEnum
+ >>> class Numbers(IntEnum):
+ ... ONE = 1
+ ... TWO = 2
+ ... THREE = 3
+ >>> Numbers.THREE
+ Numbers.THREE
+ >>> Numbers.ONE + Numbers.TWO
+ 3
+ >>> Numbers.THREE + 5
+ 8
+ >>> Numbers.THREE == 3
+ True
.. note::
- The negation operator, ``~``, always returns an :class:`IntFlag` member with a
- positive value::
-
- >>> (~Perm.X).value == (Perm.R|Perm.W).value == 6
- True
-
-:class:`IntFlag` members can also be iterated over::
-
- >>> list(RW)
- [<Perm.R: 4>, <Perm.W: 2>]
-
-.. versionadded:: 3.10
-
-
-Flag
-^^^^
+ Using :class:`auto` with :class:`IntEnum` results in integers of increasing value,
+ starting with ``1``.
-The last variation is :class:`Flag`. Like :class:`IntFlag`, :class:`Flag`
-members can be combined using the bitwise operators (&, \|, ^, ~). Unlike
-:class:`IntFlag`, they cannot be combined with, nor compared against, any
-other :class:`Flag` enumeration, nor :class:`int`. While it is possible to
-specify the values directly it is recommended to use :class:`auto` as the
-value and let :class:`Flag` select an appropriate value.
-.. versionadded:: 3.6
-
-Like :class:`IntFlag`, if a combination of :class:`Flag` members results in no
-flags being set, the boolean evaluation is :data:`False`::
-
- >>> from enum import Flag, auto
- >>> class Color(Flag):
- ... RED = auto()
- ... BLUE = auto()
- ... GREEN = auto()
- ...
- >>> Color.RED & Color.GREEN
- <Color: 0>
- >>> bool(Color.RED & Color.GREEN)
- False
-
-Individual flags should have values that are powers of two (1, 2, 4, 8, ...),
-while combinations of flags won't::
-
- >>> class Color(Flag):
- ... RED = auto()
- ... BLUE = auto()
- ... GREEN = auto()
- ... WHITE = RED | BLUE | GREEN
- ...
- >>> Color.WHITE
- <Color.WHITE: 7>
-
-Giving a name to the "no flags set" condition does not change its boolean
-value::
-
- >>> class Color(Flag):
- ... BLACK = 0
- ... RED = auto()
- ... BLUE = auto()
- ... GREEN = auto()
- ...
- >>> Color.BLACK
- <Color.BLACK: 0>
- >>> bool(Color.BLACK)
- False
-
-:class:`Flag` members can also be iterated over::
-
- >>> purple = Color.RED | Color.BLUE
- >>> list(purple)
- [<Color.RED: 1>, <Color.BLUE: 2>]
-
-.. versionadded:: 3.10
-
-.. note::
+.. class:: StrEnum
- For the majority of new code, :class:`Enum` and :class:`Flag` are strongly
- recommended, since :class:`IntEnum` and :class:`IntFlag` break some
- semantic promises of an enumeration (by being comparable to integers, and
- thus by transitivity to other unrelated enumerations). :class:`IntEnum`
- and :class:`IntFlag` should be used only in cases where :class:`Enum` and
- :class:`Flag` will not do; for example, when integer constants are replaced
- with enumerations, or for interoperability with other systems.
-
-
-Others
-^^^^^^
-
-While :class:`IntEnum` is part of the :mod:`enum` module, it would be very
-simple to implement independently::
-
- class IntEnum(int, Enum):
- pass
-
-This demonstrates how similar derived enumerations can be defined; for example
-a :class:`StrEnum` that mixes in :class:`str` instead of :class:`int`.
-
-Some rules:
-
-1. When subclassing :class:`Enum`, mix-in types must appear before
- :class:`Enum` itself in the sequence of bases, as in the :class:`IntEnum`
- example above.
-2. While :class:`Enum` can have members of any type, once you mix in an
- additional type, all the members must have values of that type, e.g.
- :class:`int` above. This restriction does not apply to mix-ins which only
- add methods and don't specify another type.
-3. When another data type is mixed in, the :attr:`value` attribute is *not the
- same* as the enum member itself, although it is equivalent and will compare
- equal.
-4. %-style formatting: `%s` and `%r` call the :class:`Enum` class's
- :meth:`__str__` and :meth:`__repr__` respectively; other codes (such as
- `%i` or `%h` for IntEnum) treat the enum member as its mixed-in type.
-5. :ref:`Formatted string literals <f-strings>`, :meth:`str.format`,
- and :func:`format` will use the mixed-in type's :meth:`__format__`
- unless :meth:`__str__` or :meth:`__format__` is overridden in the subclass,
- in which case the overridden methods or :class:`Enum` methods will be used.
- Use the !s and !r format codes to force usage of the :class:`Enum` class's
- :meth:`__str__` and :meth:`__repr__` methods.
-
-When to use :meth:`__new__` vs. :meth:`__init__`
-------------------------------------------------
-
-:meth:`__new__` must be used whenever you want to customize the actual value of
-the :class:`Enum` member. Any other modifications may go in either
-:meth:`__new__` or :meth:`__init__`, with :meth:`__init__` being preferred.
-
-For example, if you want to pass several items to the constructor, but only
-want one of them to be the value::
-
- >>> class Coordinate(bytes, Enum):
- ... """
- ... Coordinate with binary codes that can be indexed by the int code.
- ... """
- ... def __new__(cls, value, label, unit):
- ... obj = bytes.__new__(cls, [value])
- ... obj._value_ = value
- ... obj.label = label
- ... obj.unit = unit
- ... return obj
- ... PX = (0, 'P.X', 'km')
- ... PY = (1, 'P.Y', 'km')
- ... VX = (2, 'V.X', 'km/s')
- ... VY = (3, 'V.Y', 'km/s')
- ...
-
- >>> print(Coordinate['PY'])
- Coordinate.PY
-
- >>> print(Coordinate(3))
- Coordinate.VY
-
-Interesting examples
---------------------
-
-While :class:`Enum`, :class:`IntEnum`, :class:`IntFlag`, and :class:`Flag` are
-expected to cover the majority of use-cases, they cannot cover them all. Here
-are recipes for some different types of enumerations that can be used directly,
-or as examples for creating one's own.
-
-
-Omitting values
-^^^^^^^^^^^^^^^
-
-In many use-cases one doesn't care what the actual value of an enumeration
-is. There are several ways to define this type of simple enumeration:
-
-- use instances of :class:`auto` for the value
-- use instances of :class:`object` as the value
-- use a descriptive string as the value
-- use a tuple as the value and a custom :meth:`__new__` to replace the
- tuple with an :class:`int` value
-
-Using any of these methods signifies to the user that these values are not
-important, and also enables one to add, remove, or reorder members without
-having to renumber the remaining members.
-
-Whichever method you choose, you should provide a :meth:`repr` that also hides
-the (unimportant) value::
-
- >>> class NoValue(Enum):
- ... def __repr__(self):
- ... return '<%s.%s>' % (self.__class__.__name__, self.name)
- ...
-
-
-Using :class:`auto`
-"""""""""""""""""""
-
-Using :class:`auto` would look like::
-
- >>> class Color(NoValue):
- ... RED = auto()
- ... BLUE = auto()
- ... GREEN = auto()
- ...
- >>> Color.GREEN
- <Color.GREEN>
-
-
-Using :class:`object`
-"""""""""""""""""""""
-
-Using :class:`object` would look like::
-
- >>> class Color(NoValue):
- ... RED = object()
- ... GREEN = object()
- ... BLUE = object()
- ...
- >>> Color.GREEN
- <Color.GREEN>
-
-
-Using a descriptive string
-""""""""""""""""""""""""""
-
-Using a string as the value would look like::
-
- >>> class Color(NoValue):
- ... RED = 'stop'
- ... GREEN = 'go'
- ... BLUE = 'too fast!'
- ...
- >>> Color.GREEN
- <Color.GREEN>
- >>> Color.GREEN.value
- 'go'
-
-
-Using a custom :meth:`__new__`
-""""""""""""""""""""""""""""""
-
-Using an auto-numbering :meth:`__new__` would look like::
-
- >>> class AutoNumber(NoValue):
- ... def __new__(cls):
- ... value = len(cls.__members__) + 1
- ... obj = object.__new__(cls)
- ... obj._value_ = value
- ... return obj
- ...
- >>> class Color(AutoNumber):
- ... RED = ()
- ... GREEN = ()
- ... BLUE = ()
- ...
- >>> Color.GREEN
- <Color.GREEN>
- >>> Color.GREEN.value
- 2
-
-To make a more general purpose ``AutoNumber``, add ``*args`` to the signature::
-
- >>> class AutoNumber(NoValue):
- ... def __new__(cls, *args): # this is the only change from above
- ... value = len(cls.__members__) + 1
- ... obj = object.__new__(cls)
- ... obj._value_ = value
- ... return obj
- ...
-
-Then when you inherit from ``AutoNumber`` you can write your own ``__init__``
-to handle any extra arguments::
-
- >>> class Swatch(AutoNumber):
- ... def __init__(self, pantone='unknown'):
- ... self.pantone = pantone
- ... AUBURN = '3497'
- ... SEA_GREEN = '1246'
- ... BLEACHED_CORAL = () # New color, no Pantone code yet!
- ...
- >>> Swatch.SEA_GREEN
- <Swatch.SEA_GREEN>
- >>> Swatch.SEA_GREEN.pantone
- '1246'
- >>> Swatch.BLEACHED_CORAL.pantone
- 'unknown'
+ *StrEnum* is the same as *Enum*, but its members are also strings and can be used
+ in most of the same places that a string can be used. The result of any string
+ operation performed on or with a *StrEnum* member is not part of the enumeration.
-.. note::
+ .. note:: There are places in the stdlib that check for an exact :class:`str`
+ instead of a :class:`str` subclass (i.e. ``type(unknown) == str``
+ instead of ``isinstance(str, unknown)``), and in those locations you
+ will need to use ``str(StrEnum.member)``.
- The :meth:`__new__` method, if defined, is used during creation of the Enum
- members; it is then replaced by Enum's :meth:`__new__` which is used after
- class creation for lookup of existing members.
-
-
-OrderedEnum
-^^^^^^^^^^^
-
-An ordered enumeration that is not based on :class:`IntEnum` and so maintains
-the normal :class:`Enum` invariants (such as not being comparable to other
-enumerations)::
-
- >>> class OrderedEnum(Enum):
- ... def __ge__(self, other):
- ... if self.__class__ is other.__class__:
- ... return self.value >= other.value
- ... return NotImplemented
- ... def __gt__(self, other):
- ... if self.__class__ is other.__class__:
- ... return self.value > other.value
- ... return NotImplemented
- ... def __le__(self, other):
- ... if self.__class__ is other.__class__:
- ... return self.value <= other.value
- ... return NotImplemented
- ... def __lt__(self, other):
- ... if self.__class__ is other.__class__:
- ... return self.value < other.value
- ... return NotImplemented
- ...
- >>> class Grade(OrderedEnum):
- ... A = 5
- ... B = 4
- ... C = 3
- ... D = 2
- ... F = 1
- ...
- >>> Grade.C < Grade.A
- True
-
-
-DuplicateFreeEnum
-^^^^^^^^^^^^^^^^^
-
-Raises an error if a duplicate member name is found instead of creating an
-alias::
-
- >>> class DuplicateFreeEnum(Enum):
- ... def __init__(self, *args):
- ... cls = self.__class__
- ... if any(self.value == e.value for e in cls):
- ... a = self.name
- ... e = cls(self.value).name
- ... raise ValueError(
- ... "aliases not allowed in DuplicateFreeEnum: %r --> %r"
- ... % (a, e))
- ...
- >>> class Color(DuplicateFreeEnum):
- ... RED = 1
- ... GREEN = 2
- ... BLUE = 3
- ... GRENE = 2
- ...
- Traceback (most recent call last):
- ...
- ValueError: aliases not allowed in DuplicateFreeEnum: 'GRENE' --> 'GREEN'
.. note::
- This is a useful example for subclassing Enum to add or change other
- behaviors as well as disallowing aliases. If the only desired change is
- disallowing aliases, the :func:`unique` decorator can be used instead.
-
-
-Planet
-^^^^^^
-
-If :meth:`__new__` or :meth:`__init__` is defined the value of the enum member
-will be passed to those methods::
-
- >>> class Planet(Enum):
- ... MERCURY = (3.303e+23, 2.4397e6)
- ... VENUS = (4.869e+24, 6.0518e6)
- ... EARTH = (5.976e+24, 6.37814e6)
- ... MARS = (6.421e+23, 3.3972e6)
- ... JUPITER = (1.9e+27, 7.1492e7)
- ... SATURN = (5.688e+26, 6.0268e7)
- ... URANUS = (8.686e+25, 2.5559e7)
- ... NEPTUNE = (1.024e+26, 2.4746e7)
- ... def __init__(self, mass, radius):
- ... self.mass = mass # in kilograms
- ... self.radius = radius # in meters
- ... @property
- ... def surface_gravity(self):
- ... # universal gravitational constant (m3 kg-1 s-2)
- ... G = 6.67300E-11
- ... return G * self.mass / (self.radius * self.radius)
- ...
- >>> Planet.EARTH.value
- (5.976e+24, 6378140.0)
- >>> Planet.EARTH.surface_gravity
- 9.802652743337129
+ Using :class:`auto` with :class:`StrEnum` results in values of the member name,
+ lower-cased.
-TimePeriod
-^^^^^^^^^^
+.. class:: Flag
-An example to show the :attr:`_ignore_` attribute in use::
+ *Flag* members support the bitwise operators ``&`` (*AND*), ``|`` (*OR*),
+ ``^`` (*XOR*), and ``~`` (*INVERT*); the results of those operators are members
+ of the enumeration.
- >>> from datetime import timedelta
- >>> class Period(timedelta, Enum):
- ... "different lengths of time"
- ... _ignore_ = 'Period i'
- ... Period = vars()
- ... for i in range(367):
- ... Period['day_%d' % i] = i
- ...
- >>> list(Period)[:2]
- [<Period.day_0: datetime.timedelta(0)>, <Period.day_1: datetime.timedelta(days=1)>]
- >>> list(Period)[-2:]
- [<Period.day_365: datetime.timedelta(days=365)>, <Period.day_366: datetime.timedelta(days=366)>]
+ .. method:: __contains__(self, value)
+ Returns *True* if value is in self::
-How are Enums different?
-------------------------
+ >>> from enum import Flag, auto
+ >>> class Color(Flag):
+ ... RED = auto()
+ ... GREEN = auto()
+ ... BLUE = auto()
+ >>> purple = Color.RED | Color.BLUE
+ >>> white = Color.RED | Color.GREEN | Color.BLUE
+ >>> Color.GREEN in purple
+ False
+ >>> Color.GREEN in white
+ True
+ >>> purple in white
+ True
+ >>> white in purple
+ False
-Enums have a custom metaclass that affects many aspects of both derived Enum
-classes and their instances (members).
+ .. method:: __iter__(self):
+ Returns all contained members::
-Enum Classes
-^^^^^^^^^^^^
+ >>> list(Color.RED)
+ [Color.RED]
+ >>> list(purple)
+ [Color.RED, Color.BLUE]
-The :class:`EnumMeta` metaclass is responsible for providing the
-:meth:`__contains__`, :meth:`__dir__`, :meth:`__iter__` and other methods that
-allow one to do things with an :class:`Enum` class that fail on a typical
-class, such as `list(Color)` or `some_enum_var in Color`. :class:`EnumMeta` is
-responsible for ensuring that various other methods on the final :class:`Enum`
-class are correct (such as :meth:`__new__`, :meth:`__getnewargs__`,
-:meth:`__str__` and :meth:`__repr__`).
+ .. method:: __len__(self):
+ Returns number of members in flag::
-Enum Members (aka instances)
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ >>> len(Color.GREEN)
+ 1
+ >>> len(white)
+ 3
-The most interesting thing about Enum members is that they are singletons.
-:class:`EnumMeta` creates them all while it is creating the :class:`Enum`
-class itself, and then puts a custom :meth:`__new__` in place to ensure
-that no new ones are ever instantiated by returning only the existing
-member instances.
+ .. method:: __bool__(self):
+ Returns *True* if any members in flag, *False* otherwise::
-Finer Points
-^^^^^^^^^^^^
+ >>> bool(Color.GREEN)
+ True
+ >>> bool(white)
+ True
+ >>> black = Color(0)
+ >>> bool(black)
+ False
-Supported ``__dunder__`` names
-""""""""""""""""""""""""""""""
+ .. method:: __or__(self, other)
-:attr:`__members__` is a read-only ordered mapping of ``member_name``:``member``
-items. It is only available on the class.
+ Returns current flag binary or'ed with other::
-:meth:`__new__`, if specified, must create and return the enum members; it is
-also a very good idea to set the member's :attr:`_value_` appropriately. Once
-all the members are created it is no longer used.
+ >>> Color.RED | Color.GREEN
+ Color.RED|Color.GREEN
+ .. method:: __and__(self, other)
-Supported ``_sunder_`` names
-""""""""""""""""""""""""""""
+ Returns current flag binary and'ed with other::
-- ``_name_`` -- name of the member
-- ``_value_`` -- value of the member; can be set / modified in ``__new__``
-
-- ``_missing_`` -- a lookup function used when a value is not found; may be
- overridden
-- ``_ignore_`` -- a list of names, either as a :class:`list` or a :class:`str`,
- that will not be transformed into members, and will be removed from the final
- class
-- ``_order_`` -- used in Python 2/3 code to ensure member order is consistent
- (class attribute, removed during class creation)
-- ``_generate_next_value_`` -- used by the `Functional API`_ and by
- :class:`auto` to get an appropriate value for an enum member; may be
- overridden
+ >>> purple & white
+ Color.RED|Color.BLUE
+ >>> purple & Color.GREEN
+ 0x0
-.. note::
+ .. method:: __xor__(self, other)
- For standard :class:`Enum` classes the next value chosen is the last value seen
- incremented by one.
+ Returns current flag binary xor'ed with other::
- For :class:`Flag`-type classes the next value chosen will be the next highest
- power-of-two, regardless of the last value seen.
+ >>> purple ^ white
+ Color.GREEN
+ >>> purple ^ Color.GREEN
+ Color.RED|Color.GREEN|Color.BLUE
-.. versionadded:: 3.6 ``_missing_``, ``_order_``, ``_generate_next_value_``
-.. versionadded:: 3.7 ``_ignore_``
+ .. method:: __invert__(self):
-To help keep Python 2 / Python 3 code in sync an :attr:`_order_` attribute can
-be provided. It will be checked against the actual order of the enumeration
-and raise an error if the two do not match::
+ Returns all the flags in *type(self)* that are not in self::
- >>> class Color(Enum):
- ... _order_ = 'RED GREEN BLUE'
- ... RED = 1
- ... BLUE = 3
- ... GREEN = 2
- ...
- Traceback (most recent call last):
- ...
- TypeError: member order does not match _order_:
- ['RED', 'BLUE', 'GREEN']
- ['RED', 'GREEN', 'BLUE']
+ >>> ~white
+ 0x0
+ >>> ~purple
+ Color.GREEN
+ >>> ~Color.RED
+ Color.GREEN|Color.BLUE
.. note::
- In Python 2 code the :attr:`_order_` attribute is necessary as definition
- order is lost before it can be recorded.
-
-
-_Private__names
-"""""""""""""""
-
-Private names are not converted to Enum members, but remain normal attributes.
-
-.. versionchanged:: 3.10
-
-
-``Enum`` member type
-""""""""""""""""""""
+ Using :class:`auto` with :class:`Flag` results in integers that are powers
+ of two, starting with ``1``.
-:class:`Enum` members are instances of their :class:`Enum` class, and are
-normally accessed as ``EnumClass.member``. In Python versions ``3.5`` to
-``3.9`` you could access members from other members -- this practice was
-discouraged, and in ``3.12`` :class:`Enum` will return to not allowing it,
-while in ``3.10`` and ``3.11`` it will raise a :exc:`DeprecationWarning`::
- >>> class FieldTypes(Enum):
- ... name = 0
- ... value = 1
- ... size = 2
- ...
- >>> FieldTypes.value.size # doctest: +SKIP
- DeprecationWarning: accessing one member from another is not supported,
- and will be disabled in 3.12
- <FieldTypes.size: 2>
-
-.. versionchanged:: 3.5
-.. versionchanged:: 3.10
-
-
-Creating members that are mixed with other data types
-"""""""""""""""""""""""""""""""""""""""""""""""""""""
-
-When subclassing other data types, such as :class:`int` or :class:`str`, with
-an :class:`Enum`, all values after the `=` are passed to that data type's
-constructor. For example::
+.. class:: IntFlag
- >>> class MyEnum(IntEnum):
- ... example = '11', 16 # '11' will be interpreted as a hexadecimal
- ... # number
- >>> MyEnum.example
- <MyEnum.example: 17>
+ *IntFlag* is the same as *Flag*, but its members are also integers and can be
+ used anywhere that an integer can be used.
+ >>> from enum import IntFlag, auto
+ >>> class Color(IntFlag):
+ ... RED = auto()
+ ... GREEN = auto()
+ ... BLUE = auto()
+ >>> Color.RED & 2
+ 0x0
+ >>> Color.RED | 2
+ Color.RED|Color.GREEN
-Boolean value of ``Enum`` classes and members
-"""""""""""""""""""""""""""""""""""""""""""""
+ If any integer operation is performed with an *IntFlag* member, the result is
+ not an *IntFlag*::
-:class:`Enum` members that are mixed with non-:class:`Enum` types (such as
-:class:`int`, :class:`str`, etc.) are evaluated according to the mixed-in
-type's rules; otherwise, all members evaluate as :data:`True`. To make your
-own Enum's boolean evaluation depend on the member's value add the following to
-your class::
+ >>> Color.RED + 2
+ 3
- def __bool__(self):
- return bool(self.value)
+ If a *Flag* operation is performed with an *IntFlag* member and:
-:class:`Enum` classes always evaluate as :data:`True`.
+ * the result is a valid *IntFlag*: an *IntFlag* is returned
+ * the result is not a valid *IntFlag*: the result depends on the *FlagBoundary* setting
+.. note::
-``Enum`` classes with methods
-"""""""""""""""""""""""""""""
+ Using :class:`auto` with :class:`IntFlag` results in integers that are powers
+ of two, starting with ``1``.
-If you give your :class:`Enum` subclass extra methods, like the `Planet`_
-class above, those methods will show up in a :func:`dir` of the member,
-but not of the class::
+.. class:: FlagBoundary
- >>> dir(Planet)
- ['EARTH', 'JUPITER', 'MARS', 'MERCURY', 'NEPTUNE', 'SATURN', 'URANUS', 'VENUS', '__class__', '__doc__', '__members__', '__module__']
- >>> dir(Planet.EARTH)
- ['__class__', '__doc__', '__module__', 'mass', 'name', 'radius', 'surface_gravity', 'value']
+ *FlagBoundary* controls how out-of-range values are handled in *Flag* and its
+ subclasses.
+ .. attribute:: STRICT
-Combining members of ``Flag``
-"""""""""""""""""""""""""""""
+ Out-of-range values cause a :exc:`ValueError` to be raised. This is the
+ default for :class:`Flag`::
-Iterating over a combination of Flag members will only return the members that
-are comprised of a single bit::
+ >>> from enum import STRICT
+ >>> class StrictFlag(Flag, boundary=STRICT):
+ ... RED = auto()
+ ... GREEN = auto()
+ ... BLUE = auto()
+ >>> StrictFlag(2**2 + 2**4)
+ Traceback (most recent call last):
+ ...
+ ValueError: StrictFlag: invalid value: 20
+ given 0b0 10100
+ allowed 0b0 00111
- >>> class Color(Flag):
- ... RED = auto()
- ... GREEN = auto()
- ... BLUE = auto()
- ... MAGENTA = RED | BLUE
- ... YELLOW = RED | GREEN
- ... CYAN = GREEN | BLUE
- ...
- >>> Color(3)
- <Color.YELLOW: 3>
- >>> Color(7)
- <Color.RED|GREEN|BLUE: 7>
+ .. attribute:: CONFORM
-``StrEnum`` and :meth:`str.__str__`
-"""""""""""""""""""""""""""""""""""
+ Out-of-range values have invalid values removed, leaving a valid *Flag*
+ value::
-An important difference between :class:`StrEnum` and other Enums is the
-:meth:`__str__` method; because :class:`StrEnum` members are strings, some
-parts of Python will read the string data directly, while others will call
-:meth:`str()`. To make those two operations have the same result,
-:meth:`StrEnum.__str__` will be the same as :meth:`str.__str__` so that
-``str(StrEnum.member) == StrEnum.member`` is true.
+ >>> from enum import CONFORM
+ >>> class ConformFlag(Flag, boundary=CONFORM):
+ ... RED = auto()
+ ... GREEN = auto()
+ ... BLUE = auto()
+ >>> ConformFlag(2**2 + 2**4)
+ ConformFlag.BLUE
-``Flag`` and ``IntFlag`` minutia
-""""""""""""""""""""""""""""""""
+ .. attribute:: EJECT
-The code sample::
+ Out-of-range values lose their *Flag* membership and revert to :class:`int`.
+ This is the default for :class:`IntFlag`::
- >>> class Color(IntFlag):
- ... BLACK = 0
- ... RED = 1
- ... GREEN = 2
- ... BLUE = 4
- ... PURPLE = RED | BLUE
- ... WHITE = RED | GREEN | BLUE
- ...
+ >>> from enum import EJECT
+ >>> class EjectFlag(Flag, boundary=EJECT):
+ ... RED = auto()
+ ... GREEN = auto()
+ ... BLUE = auto()
+ >>> EjectFlag(2**2 + 2**4)
+ 20
-- single-bit flags are canonical
-- multi-bit and zero-bit flags are aliases
-- only canonical flags are returned during iteration::
+ .. attribute:: KEEP
- >>> list(Color.WHITE)
- [<Color.RED: 1>, <Color.GREEN: 2>, <Color.BLUE: 4>]
+ Out-of-range values are kept, and the *Flag* membership is kept. This is
+ used for some stdlib flags:
-- negating a flag or flag set returns a new flag/flag set with the
- corresponding positive integer value::
+ >>> from enum import KEEP
+ >>> class KeepFlag(Flag, boundary=KEEP):
+ ... RED = auto()
+ ... GREEN = auto()
+ ... BLUE = auto()
+ >>> KeepFlag(2**2 + 2**4)
+ KeepFlag.BLUE|0x10
- >>> Color.GREEN
- <Color.GREEN: 2>
- >>> ~Color.GREEN
- <Color.PURPLE: 5>
+Utilites and Decorators
+-----------------------
-- names of pseudo-flags are constructed from their members' names::
+.. class:: auto
- >>> (Color.RED | Color.GREEN).name
- 'RED|GREEN'
+ *auto* can be used in place of a value. If used, the *Enum* machinery will
+ call an *Enum*'s :meth:`_generate_next_value_` to get an appropriate value.
+ For *Enum* and *IntEnum* that appropriate value will be the last value plus
+ one; for *Flag* and *IntFlag* it will be the first power-of-two greater
+ than the last value; for *StrEnum* it will be the lower-cased version of the
+ member's name.
-- multi-bit flags, aka aliases, can be returned from operations::
+ ``_generate_next_value_`` can be overridden to customize the values used by
+ *auto*.
- >>> Color.RED | Color.BLUE
- <Color.PURPLE: 5>
+.. decorator:: global_enum
- >>> Color(7) # or Color(-1)
- <Color.WHITE: 7>
+ A :keyword:`class` decorator specifically for enumerations. It replaces the
+ :meth:`__repr__` method with one that shows *module_name*.*member_name*. It
+ also injects the members, and their aliases, into the the global namespace
+ they were defined in.
-- membership / containment checking has changed slightly -- zero valued flags
- are never considered to be contained::
- >>> Color.BLACK in Color.WHITE
- False
+.. decorator:: property
- otherwise, if all bits of one flag are in the other flag, True is returned::
+ A decorator similar to the built-in *property*, but specifically for
+ enumerations. It allows member attributes to have the same names as members
+ themselves.
- >>> Color.PURPLE in Color.WHITE
- True
+ .. note:: the *property* and the member must be defined in separate classes;
+ for example, the *value* and *name* attributes are defined in the
+ *Enum* class, and *Enum* subclasses can define members with the
+ names ``value`` and ``name``.
-There is a new boundary mechanism that controls how out-of-range / invalid
-bits are handled: ``STRICT``, ``CONFORM``, ``EJECT``, and ``KEEP``:
+.. decorator:: unique
- * STRICT --> raises an exception when presented with invalid values
- * CONFORM --> discards any invalid bits
- * EJECT --> lose Flag status and become a normal int with the given value
- * KEEP --> keep the extra bits
- - keeps Flag status and extra bits
- - extra bits do not show up in iteration
- - extra bits do show up in repr() and str()
+ A :keyword:`class` decorator specifically for enumerations. It searches an
+ enumeration's :attr:`__members__`, gathering any aliases it finds; if any are
+ found :exc:`ValueError` is raised with the details::
+
+ >>> from enum import Enum, unique
+ >>> @unique
+ ... class Mistake(Enum):
+ ... ONE = 1
+ ... TWO = 2
+ ... THREE = 3
+ ... FOUR = 3
+ ...
+ Traceback (most recent call last):
+ ...
+ ValueError: duplicate values found in <enum 'Mistake'>: FOUR -> THREE
-The default for Flag is ``STRICT``, the default for ``IntFlag`` is ``DISCARD``,
-and the default for ``_convert_`` is ``KEEP`` (see ``ssl.Options`` for an
-example of when ``KEEP`` is needed).
diff --git a/Doc/library/http.rst b/Doc/library/http.rst
index 14ee73363e62e..1569d504c7f92 100644
--- a/Doc/library/http.rst
+++ b/Doc/library/http.rst
@@ -35,7 +35,7 @@ associated messages through the :class:`http.HTTPStatus` enum:
>>> from http import HTTPStatus
>>> HTTPStatus.OK
- <HTTPStatus.OK: 200>
+ HTTPStatus.OK
>>> HTTPStatus.OK == 200
True
>>> HTTPStatus.OK.value
@@ -45,7 +45,7 @@ associated messages through the :class:`http.HTTPStatus` enum:
>>> HTTPStatus.OK.description
'Request fulfilled, document follows'
>>> list(HTTPStatus)
- [<HTTPStatus.CONTINUE: 100>, <HTTPStatus.SWITCHING_PROTOCOLS: 101>, ...]
+ [HTTPStatus.CONTINUE, HTTPStatus.SWITCHING_PROTOCOLS, ...]
.. _http-status-codes:
diff --git a/Doc/library/socket.rst b/Doc/library/socket.rst
index 31d804ce294a8..30b3c5e24eefc 100755
--- a/Doc/library/socket.rst
+++ b/Doc/library/socket.rst
@@ -785,9 +785,9 @@ The :mod:`socket` module also offers various network-related services:
system if IPv6 isn't enabled)::
>>> socket.getaddrinfo("example.org", 80, proto=socket.IPPROTO_TCP)
- [(<AddressFamily.AF_INET6: 10>, <SocketType.SOCK_STREAM: 1>,
+ [(socket.AF_INET6, socket.SOCK_STREAM,
6, '', ('2606:2800:220:1:248:1893:25c8:1946', 80, 0, 0)),
- (<AddressFamily.AF_INET: 2>, <SocketType.SOCK_STREAM: 1>,
+ (socket.AF_INET, socket.SOCK_STREAM,
6, '', ('93.184.216.34', 80))]
.. versionchanged:: 3.2
diff --git a/Doc/library/ssl.rst b/Doc/library/ssl.rst
index c0789ee5cfc0e..93331681266de 100644
--- a/Doc/library/ssl.rst
+++ b/Doc/library/ssl.rst
@@ -2062,7 +2062,7 @@ to speed up repeated connections from the same clients.
:attr:`SSLContext.verify_flags` returns :class:`VerifyFlags` flags:
>>> ssl.create_default_context().verify_flags # doctest: +SKIP
- <VerifyFlags.VERIFY_X509_TRUSTED_FIRST: 32768>
+ ssl.VERIFY_X509_TRUSTED_FIRST
.. attribute:: SSLContext.verify_mode
@@ -2074,7 +2074,7 @@ to speed up repeated connections from the same clients.
:attr:`SSLContext.verify_mode` returns :class:`VerifyMode` enum:
>>> ssl.create_default_context().verify_mode
- <VerifyMode.CERT_REQUIRED: 2>
+ ssl.CERT_REQUIRED
.. index:: single: certificates
diff --git a/Doc/whatsnew/3.10.rst b/Doc/whatsnew/3.10.rst
index e09cfb44276ab..ea2834bc76145 100644
--- a/Doc/whatsnew/3.10.rst
+++ b/Doc/whatsnew/3.10.rst
@@ -716,6 +716,14 @@ encodings
:func:`encodings.normalize_encoding` now ignores non-ASCII characters.
(Contributed by Hai Shi in :issue:`39337`.)
+enum
+----
+
+:class:`Enum` :func:`__repr__` now returns ``enum_name.member_name`` and
+:func:`__str__` now returns ``member_name``. Stdlib enums available as
+module constants have a :func:`repr` of ``module_name.member_name``.
+(Contributed by Ethan Furman in :issue:`40066`.)
+
gc
--
diff --git a/Lib/enum.py b/Lib/enum.py
index 84c7b0dc2afbe..f31779baa0d65 100644
--- a/Lib/enum.py
+++ b/Lib/enum.py
@@ -4,17 +4,18 @@
__all__ = [
- 'EnumMeta',
+ 'EnumType', 'EnumMeta',
'Enum', 'IntEnum', 'StrEnum', 'Flag', 'IntFlag',
'auto', 'unique',
'property',
'FlagBoundary', 'STRICT', 'CONFORM', 'EJECT', 'KEEP',
+ 'global_flag_repr', 'global_enum_repr', 'global_enum',
]
# Dummy value for Enum and Flag as there are explicit checks for them
# before they have been created.
-# This is also why there are checks in EnumMeta like `if Enum is not None`
+# This is also why there are checks in EnumType like `if Enum is not None`
Enum = Flag = EJECT = None
def _is_descriptor(obj):
@@ -285,7 +286,7 @@ class _EnumDict(dict):
"""
Track enum member order and ensure member names are not reused.
- EnumMeta will use the names found in self._member_names as the
+ EnumType will use the names found in self._member_names as the
enumeration member names.
"""
def __init__(self):
@@ -321,7 +322,8 @@ def __setitem__(self, key, value):
# check if members already defined as auto()
if self._auto_called:
raise TypeError("_generate_next_value_ must be defined before members")
- setattr(self, '_generate_next_value', value)
+ _gnv = value.__func__ if isinstance(value, staticmethod) else value
+ setattr(self, '_generate_next_value', _gnv)
elif key == '_ignore_':
if isinstance(value, str):
value = value.replace(',',' ').split()
@@ -368,7 +370,7 @@ def update(self, members, **more_members):
self[name] = value
-class EnumMeta(type):
+class EnumType(type):
"""
Metaclass for Enum
"""
@@ -756,9 +758,9 @@ def _convert_(cls, name, module, filter, source=None, boundary=None):
# module;
# also, replace the __reduce_ex__ method so unpickling works in
# previous Python versions
- module_globals = vars(sys.modules[module])
+ module_globals = sys.modules[module].__dict__
if source:
- source = vars(source)
+ source = source.__dict__
else:
source = module_globals
# _value2member_map_ is populated in the same order every time
@@ -776,7 +778,7 @@ def _convert_(cls, name, module, filter, source=None, boundary=None):
members.sort(key=lambda t: t[0])
cls = cls(name, members, module=module, boundary=boundary or KEEP)
cls.__reduce_ex__ = _reduce_ex_by_name
- module_globals.update(cls.__members__)
+ global_enum(cls)
module_globals[name] = cls
return cls
@@ -881,9 +883,10 @@ def _find_new_(classdict, member_type, first_enum):
else:
use_args = True
return __new__, save_new, use_args
+EnumMeta = EnumType
-class Enum(metaclass=EnumMeta):
+class Enum(metaclass=EnumType):
"""
Generic enumeration.
@@ -958,11 +961,10 @@ def _missing_(cls, value):
return None
def __repr__(self):
- return "<%s.%s: %r>" % (
- self.__class__.__name__, self._name_, self._value_)
+ return "%s.%s" % ( self.__class__.__name__, self._name_)
def __str__(self):
- return "%s.%s" % (self.__class__.__name__, self._name_)
+ return "%s" % (self._name_, )
def __dir__(self):
"""
@@ -1220,19 +1222,28 @@ def __len__(self):
return self._value_.bit_count()
def __repr__(self):
- cls = self.__class__
- if self._name_ is not None:
- return '<%s.%s: %r>' % (cls.__name__, self._name_, self._value_)
+ cls_name = self.__class__.__name__
+ if self._name_ is None:
+ return "0x%x" % (self._value_, )
+ if _is_single_bit(self._value_):
+ return '%s.%s' % (cls_name, self._name_)
+ if self._boundary_ is not FlagBoundary.KEEP:
+ return '%s.' % cls_name + ('|%s.' % cls_name).join(self.name.split('|'))
else:
- # only zero is unnamed by default
- return '<%s: %r>' % (cls.__name__, self._value_)
+ name = []
+ for n in self._name_.split('|'):
+ if n.startswith('0'):
+ name.append(n)
+ else:
+ name.append('%s.%s' % (cls_name, n))
+ return '|'.join(name)
def __str__(self):
cls = self.__class__
- if self._name_ is not None:
- return '%s.%s' % (cls.__name__, self._name_)
+ if self._name_ is None:
+ return '%s(%x)' % (cls.__name__, self._value_)
else:
- return '%s(%s)' % (cls.__name__, self._value_)
+ return self._name_
def __bool__(self):
return bool(self._value_)
@@ -1329,3 +1340,38 @@ def _power_of_two(value):
if value < 1:
return False
return value == 2 ** _high_bit(value)
+
+def global_enum_repr(self):
+ return '%s.%s' % (self.__class__.__module__, self._name_)
+
+def global_flag_repr(self):
+ module = self.__class__.__module__
+ cls_name = self.__class__.__name__
+ if self._name_ is None:
+ return "%x" % (module, cls_name, self._value_)
+ if _is_single_bit(self):
+ return '%s.%s' % (module, self._name_)
+ if self._boundary_ is not FlagBoundary.KEEP:
+ return module + module.join(self.name.split('|'))
+ else:
+ name = []
+ for n in self._name_.split('|'):
+ if n.startswith('0'):
+ name.append(n)
+ else:
+ name.append('%s.%s' % (module, n))
+ return '|'.join(name)
+
+
+def global_enum(cls):
+ """
+ decorator that makes the repr() of an enum member reference its module
+ instead of its class; also exports all members to the enum's module's
+ global namespace
+ """
+ if issubclass(cls, Flag):
+ cls.__repr__ = global_flag_repr
+ else:
+ cls.__repr__ = global_enum_repr
+ sys.modules[cls.__module__].__dict__.update(cls.__members__)
+ return cls
diff --git a/Lib/inspect.py b/Lib/inspect.py
index 1f2cdebd899f8..d6d2ce6461777 100644
--- a/Lib/inspect.py
+++ b/Lib/inspect.py
@@ -2455,9 +2455,6 @@ class _ParameterKind(enum.IntEnum):
KEYWORD_ONLY = 3
VAR_KEYWORD = 4
- def __str__(self):
- return self._name_
-
@property
def description(self):
return _PARAM_NAME_MAPPING[self]
diff --git a/Lib/plistlib.py b/Lib/plistlib.py
index 2eeebe4c9a424..5772efdfe6710 100644
--- a/Lib/plistlib.py
+++ b/Lib/plistlib.py
@@ -61,8 +61,7 @@
from xml.parsers.expat import ParserCreate
-PlistFormat = enum.Enum('PlistFormat', 'FMT_XML FMT_BINARY', module=__name__)
-globals().update(PlistFormat.__members__)
+PlistFormat = enum.global_enum(enum.Enum('PlistFormat', 'FMT_XML FMT_BINARY', module=__name__))
class UID:
diff --git a/Lib/re.py b/Lib/re.py
index a39ff047c26b2..5e40c7b9bb17d 100644
--- a/Lib/re.py
+++ b/Lib/re.py
@@ -142,6 +142,7 @@
__version__ = "2.2.1"
+(a)enum.global_enum
class RegexFlag(enum.IntFlag, boundary=enum.KEEP):
ASCII = A = sre_compile.SRE_FLAG_ASCII # assume ascii "locale"
IGNORECASE = I = sre_compile.SRE_FLAG_IGNORECASE # ignore case
@@ -154,22 +155,6 @@ class RegexFlag(enum.IntFlag, boundary=enum.KEEP):
TEMPLATE = T = sre_compile.SRE_FLAG_TEMPLATE # disable backtracking
DEBUG = sre_compile.SRE_FLAG_DEBUG # dump pattern after compilation
- def __repr__(self):
- res = ''
- if self._name_:
- member_names = self._name_.split('|')
- constant = None
- if member_names[-1].startswith('0x'):
- constant = member_names.pop()
- res = 're.' + '|re.'.join(member_names)
- if constant:
- res += '|%s' % constant
- return res
-
- __str__ = object.__str__
-
-globals().update(RegexFlag.__members__)
-
# sre exception
error = sre_compile.error
diff --git a/Lib/test/test_enum.py b/Lib/test/test_enum.py
index 69392e01faacd..6002cd85622cf 100644
--- a/Lib/test/test_enum.py
+++ b/Lib/test/test_enum.py
@@ -7,7 +7,7 @@
import unittest
import threading
from collections import OrderedDict
-from enum import Enum, IntEnum, StrEnum, EnumMeta, Flag, IntFlag, unique, auto
+from enum import Enum, IntEnum, StrEnum, EnumType, Flag, IntFlag, unique, auto
from enum import STRICT, CONFORM, EJECT, KEEP
from io import StringIO
from pickle import dumps, loads, PicklingError, HIGHEST_PROTOCOL
@@ -262,11 +262,8 @@ def test_enum(self):
self.assertIn(e, Season)
self.assertIs(type(e), Season)
self.assertIsInstance(e, Season)
- self.assertEqual(str(e), 'Season.' + season)
- self.assertEqual(
- repr(e),
- '<Season.{0}: {1}>'.format(season, i),
- )
+ self.assertEqual(str(e), season)
+ self.assertEqual(repr(e), 'Season.{0}'.format(season))
def test_value_name(self):
Season = self.Season
@@ -440,7 +437,7 @@ def red(self):
def test_reserved__sunder_(self):
with self.assertRaisesRegex(
ValueError,
- "_sunder_ names, such as '_bad_', are reserved",
+ '_sunder_ names, such as ._bad_., are reserved',
):
class Bad(Enum):
_bad_ = 1
@@ -488,7 +485,7 @@ class EnumWithFormatOverride(Enum):
two = 2.0
def __format__(self, spec):
return 'Format!!'
- self.assertEqual(str(EnumWithFormatOverride.one), 'EnumWithFormatOverride.one')
+ self.assertEqual(str(EnumWithFormatOverride.one), 'one')
self.assertEqual('{}'.format(EnumWithFormatOverride.one), 'Format!!')
def test_str_and_format_override_enum(self):
@@ -528,7 +525,7 @@ class TestFloat(float, Enum):
two = 2.0
def __format__(self, spec):
return 'TestFloat success!'
- self.assertEqual(str(TestFloat.one), 'TestFloat.one')
+ self.assertEqual(str(TestFloat.one), 'one')
self.assertEqual('{}'.format(TestFloat.one), 'TestFloat success!')
def assertFormatIsValue(self, spec, member):
@@ -614,6 +611,8 @@ class MyEnum(HexInt, enum.Enum):
A = 1
B = 2
C = 3
+ def __repr__(self):
+ return '<%s.%s: %r>' % (self.__class__.__name__, self._name_, self._value_)
self.assertEqual(repr(MyEnum.A), '<MyEnum.A: 0x1>')
def test_too_many_data_types(self):
@@ -1959,7 +1958,7 @@ class Color(MaxMixin, Enum):
self.assertEqual(Color.GREEN.value, 2)
self.assertEqual(Color.BLUE.value, 3)
self.assertEqual(Color.MAX, 3)
- self.assertEqual(str(Color.BLUE), 'Color.BLUE')
+ self.assertEqual(str(Color.BLUE), 'BLUE')
class Color(MaxMixin, StrMixin, Enum):
RED = auto()
GREEN = auto()
@@ -2330,64 +2329,62 @@ class Color(Flag):
def test_str(self):
Perm = self.Perm
- self.assertEqual(str(Perm.R), 'Perm.R')
- self.assertEqual(str(Perm.W), 'Perm.W')
- self.assertEqual(str(Perm.X), 'Perm.X')
- self.assertEqual(str(Perm.R | Perm.W), 'Perm.R|W')
- self.assertEqual(str(Perm.R | Perm.W | Perm.X), 'Perm.R|W|X')
+ self.assertEqual(str(Perm.R), 'R')
+ self.assertEqual(str(Perm.W), 'W')
+ self.assertEqual(str(Perm.X), 'X')
+ self.assertEqual(str(Perm.R | Perm.W), 'R|W')
+ self.assertEqual(str(Perm.R | Perm.W | Perm.X), 'R|W|X')
self.assertEqual(str(Perm(0)), 'Perm(0)')
- self.assertEqual(str(~Perm.R), 'Perm.W|X')
- self.assertEqual(str(~Perm.W), 'Perm.R|X')
- self.assertEqual(str(~Perm.X), 'Perm.R|W')
- self.assertEqual(str(~(Perm.R | Perm.W)), 'Perm.X')
+ self.assertEqual(str(~Perm.R), 'W|X')
+ self.assertEqual(str(~Perm.W), 'R|X')
+ self.assertEqual(str(~Perm.X), 'R|W')
+ self.assertEqual(str(~(Perm.R | Perm.W)), 'X')
self.assertEqual(str(~(Perm.R | Perm.W | Perm.X)), 'Perm(0)')
- self.assertEqual(str(Perm(~0)), 'Perm.R|W|X')
+ self.assertEqual(str(Perm(~0)), 'R|W|X')
Open = self.Open
- self.assertEqual(str(Open.RO), 'Open.RO')
- self.assertEqual(str(Open.WO), 'Open.WO')
- self.assertEqual(str(Open.AC), 'Open.AC')
- self.assertEqual(str(Open.RO | Open.CE), 'Open.CE')
- self.assertEqual(str(Open.WO | Open.CE), 'Open.WO|CE')
- self.assertEqual(str(~Open.RO), 'Open.WO|RW|CE')
- self.assertEqual(str(~Open.WO), 'Open.RW|CE')
- self.assertEqual(str(~Open.AC), 'Open.CE')
- self.assertEqual(str(~Open.CE), 'Open.AC')
- self.assertEqual(str(~(Open.RO | Open.CE)), 'Open.AC')
- self.assertEqual(str(~(Open.WO | Open.CE)), 'Open.RW')
+ self.assertEqual(str(Open.RO), 'RO')
+ self.assertEqual(str(Open.WO), 'WO')
+ self.assertEqual(str(Open.AC), 'AC')
+ self.assertEqual(str(Open.RO | Open.CE), 'CE')
+ self.assertEqual(str(Open.WO | Open.CE), 'WO|CE')
+ self.assertEqual(str(~Open.RO), 'WO|RW|CE')
+ self.assertEqual(str(~Open.WO), 'RW|CE')
+ self.assertEqual(str(~Open.AC), 'CE')
+ self.assertEqual(str(~(Open.RO | Open.CE)), 'AC')
+ self.assertEqual(str(~(Open.WO | Open.CE)), 'RW')
def test_repr(self):
Perm = self.Perm
- self.assertEqual(repr(Perm.R), '<Perm.R: 4>')
- self.assertEqual(repr(Perm.W), '<Perm.W: 2>')
- self.assertEqual(repr(Perm.X), '<Perm.X: 1>')
- self.assertEqual(repr(Perm.R | Perm.W), '<Perm.R|W: 6>')
- self.assertEqual(repr(Perm.R | Perm.W | Perm.X), '<Perm.R|W|X: 7>')
- self.assertEqual(repr(Perm(0)), '<Perm: 0>')
- self.assertEqual(repr(~Perm.R), '<Perm.W|X: 3>')
- self.assertEqual(repr(~Perm.W), '<Perm.R|X: 5>')
- self.assertEqual(repr(~Perm.X), '<Perm.R|W: 6>')
- self.assertEqual(repr(~(Perm.R | Perm.W)), '<Perm.X: 1>')
- self.assertEqual(repr(~(Perm.R | Perm.W | Perm.X)), '<Perm: 0>')
- self.assertEqual(repr(Perm(~0)), '<Perm.R|W|X: 7>')
+ self.assertEqual(repr(Perm.R), 'Perm.R')
+ self.assertEqual(repr(Perm.W), 'Perm.W')
+ self.assertEqual(repr(Perm.X), 'Perm.X')
+ self.assertEqual(repr(Perm.R | Perm.W), 'Perm.R|Perm.W')
+ self.assertEqual(repr(Perm.R | Perm.W | Perm.X), 'Perm.R|Perm.W|Perm.X')
+ self.assertEqual(repr(Perm(0)), '0x0')
+ self.assertEqual(repr(~Perm.R), 'Perm.W|Perm.X')
+ self.assertEqual(repr(~Perm.W), 'Perm.R|Perm.X')
+ self.assertEqual(repr(~Perm.X), 'Perm.R|Perm.W')
+ self.assertEqual(repr(~(Perm.R | Perm.W)), 'Perm.X')
+ self.assertEqual(repr(~(Perm.R | Perm.W | Perm.X)), '0x0')
+ self.assertEqual(repr(Perm(~0)), 'Perm.R|Perm.W|Perm.X')
Open = self.Open
- self.assertEqual(repr(Open.RO), '<Open.RO: 0>')
- self.assertEqual(repr(Open.WO), '<Open.WO: 1>')
- self.assertEqual(repr(Open.AC), '<Open.AC: 3>')
- self.assertEqual(repr(Open.RO | Open.CE), '<Open.CE: 524288>')
- self.assertEqual(repr(Open.WO | Open.CE), '<Open.WO|CE: 524289>')
- self.assertEqual(repr(~Open.RO), '<Open.WO|RW|CE: 524291>')
- self.assertEqual(repr(~Open.WO), '<Open.RW|CE: 524290>')
- self.assertEqual(repr(~Open.AC), '<Open.CE: 524288>')
- self.assertEqual(repr(~Open.CE), '<Open.AC: 3>')
- self.assertEqual(repr(~(Open.RO | Open.CE)), '<Open.AC: 3>')
- self.assertEqual(repr(~(Open.WO | Open.CE)), '<Open.RW: 2>')
+ self.assertEqual(repr(Open.RO), 'Open.RO')
+ self.assertEqual(repr(Open.WO), 'Open.WO')
+ self.assertEqual(repr(Open.AC), 'Open.AC')
+ self.assertEqual(repr(Open.RO | Open.CE), 'Open.CE')
+ self.assertEqual(repr(Open.WO | Open.CE), 'Open.WO|Open.CE')
+ self.assertEqual(repr(~Open.RO), 'Open.WO|Open.RW|Open.CE')
+ self.assertEqual(repr(~Open.WO), 'Open.RW|Open.CE')
+ self.assertEqual(repr(~Open.AC), 'Open.CE')
+ self.assertEqual(repr(~(Open.RO | Open.CE)), 'Open.AC')
+ self.assertEqual(repr(~(Open.WO | Open.CE)), 'Open.RW')
def test_format(self):
Perm = self.Perm
- self.assertEqual(format(Perm.R, ''), 'Perm.R')
- self.assertEqual(format(Perm.R | Perm.X, ''), 'Perm.R|X')
+ self.assertEqual(format(Perm.R, ''), 'R')
+ self.assertEqual(format(Perm.R | Perm.X, ''), 'R|X')
def test_or(self):
Perm = self.Perm
@@ -2707,7 +2704,7 @@ class Color(AllMixin, Flag):
self.assertEqual(Color.GREEN.value, 2)
self.assertEqual(Color.BLUE.value, 4)
self.assertEqual(Color.ALL.value, 7)
- self.assertEqual(str(Color.BLUE), 'Color.BLUE')
+ self.assertEqual(str(Color.BLUE), 'BLUE')
class Color(AllMixin, StrMixin, Flag):
RED = auto()
GREEN = auto()
@@ -2850,77 +2847,70 @@ def test_type(self):
def test_str(self):
Perm = self.Perm
- self.assertEqual(str(Perm.R), 'Perm.R')
- self.assertEqual(str(Perm.W), 'Perm.W')
- self.assertEqual(str(Perm.X), 'Perm.X')
- self.assertEqual(str(Perm.R | Perm.W), 'Perm.R|W')
- self.assertEqual(str(Perm.R | Perm.W | Perm.X), 'Perm.R|W|X')
+ self.assertEqual(str(Perm.R), 'R')
+ self.assertEqual(str(Perm.W), 'W')
+ self.assertEqual(str(Perm.X), 'X')
+ self.assertEqual(str(Perm.R | Perm.W), 'R|W')
+ self.assertEqual(str(Perm.R | Perm.W | Perm.X), 'R|W|X')
self.assertEqual(str(Perm.R | 8), '12')
self.assertEqual(str(Perm(0)), 'Perm(0)')
self.assertEqual(str(Perm(8)), '8')
- self.assertEqual(str(~Perm.R), 'Perm.W|X')
- self.assertEqual(str(~Perm.W), 'Perm.R|X')
- self.assertEqual(str(~Perm.X), 'Perm.R|W')
- self.assertEqual(str(~(Perm.R | Perm.W)), 'Perm.X')
+ self.assertEqual(str(~Perm.R), 'W|X')
+ self.assertEqual(str(~Perm.W), 'R|X')
+ self.assertEqual(str(~Perm.X), 'R|W')
+ self.assertEqual(str(~(Perm.R | Perm.W)), 'X')
self.assertEqual(str(~(Perm.R | Perm.W | Perm.X)), 'Perm(0)')
self.assertEqual(str(~(Perm.R | 8)), '-13')
- self.assertEqual(str(Perm(~0)), 'Perm.R|W|X')
+ self.assertEqual(str(Perm(~0)), 'R|W|X')
self.assertEqual(str(Perm(~8)), '-9')
Open = self.Open
- self.assertEqual(str(Open.RO), 'Open.RO')
- self.assertEqual(str(Open.WO), 'Open.WO')
- self.assertEqual(str(Open.AC), 'Open.AC')
- self.assertEqual(str(Open.RO | Open.CE), 'Open.CE')
- self.assertEqual(str(Open.WO | Open.CE), 'Open.WO|CE')
+ self.assertEqual(str(Open.RO), 'RO')
+ self.assertEqual(str(Open.WO), 'WO')
+ self.assertEqual(str(Open.AC), 'AC')
+ self.assertEqual(str(Open.RO | Open.CE), 'CE')
+ self.assertEqual(str(Open.WO | Open.CE), 'WO|CE')
self.assertEqual(str(Open(4)), '4')
- self.assertEqual(str(~Open.RO), 'Open.WO|RW|CE')
- self.assertEqual(str(~Open.WO), 'Open.RW|CE')
- self.assertEqual(str(~Open.AC), 'Open.CE')
- self.assertEqual(str(~Open.CE), 'Open.AC')
- self.assertEqual(str(~(Open.RO | Open.CE)), 'Open.AC')
- self.assertEqual(str(~(Open.WO | Open.CE)), 'Open.RW')
+ self.assertEqual(str(~Open.RO), 'WO|RW|CE')
+ self.assertEqual(str(~Open.WO), 'RW|CE')
+ self.assertEqual(str(~Open.AC), 'CE')
+ self.assertEqual(str(~(Open.RO | Open.CE)), 'AC')
+ self.assertEqual(str(~(Open.WO | Open.CE)), 'RW')
self.assertEqual(str(Open(~4)), '-5')
- Skip = self.Skip
- self.assertEqual(str(Skip(~4)), 'Skip.FIRST|SECOND|EIGHTH')
-
def test_repr(self):
Perm = self.Perm
- self.assertEqual(repr(Perm.R), '<Perm.R: 4>')
- self.assertEqual(repr(Perm.W), '<Perm.W: 2>')
- self.assertEqual(repr(Perm.X), '<Perm.X: 1>')
- self.assertEqual(repr(Perm.R | Perm.W), '<Perm.R|W: 6>')
- self.assertEqual(repr(Perm.R | Perm.W | Perm.X), '<Perm.R|W|X: 7>')
+ self.assertEqual(repr(Perm.R), 'Perm.R')
+ self.assertEqual(repr(Perm.W), 'Perm.W')
+ self.assertEqual(repr(Perm.X), 'Perm.X')
+ self.assertEqual(repr(Perm.R | Perm.W), 'Perm.R|Perm.W')
+ self.assertEqual(repr(Perm.R | Perm.W | Perm.X), 'Perm.R|Perm.W|Perm.X')
self.assertEqual(repr(Perm.R | 8), '12')
- self.assertEqual(repr(Perm(0)), '<Perm: 0>')
+ self.assertEqual(repr(Perm(0)), '0x0')
self.assertEqual(repr(Perm(8)), '8')
- self.assertEqual(repr(~Perm.R), '<Perm.W|X: 3>')
- self.assertEqual(repr(~Perm.W), '<Perm.R|X: 5>')
- self.assertEqual(repr(~Perm.X), '<Perm.R|W: 6>')
- self.assertEqual(repr(~(Perm.R | Perm.W)), '<Perm.X: 1>')
- self.assertEqual(repr(~(Perm.R | Perm.W | Perm.X)), '<Perm: 0>')
+ self.assertEqual(repr(~Perm.R), 'Perm.W|Perm.X')
+ self.assertEqual(repr(~Perm.W), 'Perm.R|Perm.X')
+ self.assertEqual(repr(~Perm.X), 'Perm.R|Perm.W')
+ self.assertEqual(repr(~(Perm.R | Perm.W)), 'Perm.X')
+ self.assertEqual(repr(~(Perm.R | Perm.W | Perm.X)), '0x0')
self.assertEqual(repr(~(Perm.R | 8)), '-13')
- self.assertEqual(repr(Perm(~0)), '<Perm.R|W|X: 7>')
+ self.assertEqual(repr(Perm(~0)), 'Perm.R|Perm.W|Perm.X')
self.assertEqual(repr(Perm(~8)), '-9')
Open = self.Open
- self.assertEqual(repr(Open.RO), '<Open.RO: 0>')
- self.assertEqual(repr(Open.WO), '<Open.WO: 1>')
- self.assertEqual(repr(Open.AC), '<Open.AC: 3>')
- self.assertEqual(repr(Open.RO | Open.CE), '<Open.CE: 524288>')
- self.assertEqual(repr(Open.WO | Open.CE), '<Open.WO|CE: 524289>')
+ self.assertEqual(repr(Open.RO), 'Open.RO')
+ self.assertEqual(repr(Open.WO), 'Open.WO')
+ self.assertEqual(repr(Open.AC), 'Open.AC')
+ self.assertEqual(repr(Open.RO | Open.CE), 'Open.CE')
+ self.assertEqual(repr(Open.WO | Open.CE), 'Open.WO|Open.CE')
self.assertEqual(repr(Open(4)), '4')
- self.assertEqual(repr(~Open.RO), '<Open.WO|RW|CE: 524291>')
- self.assertEqual(repr(~Open.WO), '<Open.RW|CE: 524290>')
- self.assertEqual(repr(~Open.AC), '<Open.CE: 524288>')
- self.assertEqual(repr(~(Open.RO | Open.CE)), '<Open.AC: 3>')
- self.assertEqual(repr(~(Open.WO | Open.CE)), '<Open.RW: 2>')
+ self.assertEqual(repr(~Open.RO), 'Open.WO|Open.RW|Open.CE')
+ self.assertEqual(repr(~Open.WO), 'Open.RW|Open.CE')
+ self.assertEqual(repr(~Open.AC), 'Open.CE')
+ self.assertEqual(repr(~(Open.RO | Open.CE)), 'Open.AC')
+ self.assertEqual(repr(~(Open.WO | Open.CE)), 'Open.RW')
self.assertEqual(repr(Open(~4)), '-5')
- Skip = self.Skip
- self.assertEqual(repr(Skip(~4)), '<Skip.FIRST|SECOND|EIGHTH: 11>')
-
def test_format(self):
Perm = self.Perm
self.assertEqual(format(Perm.R, ''), '4')
@@ -3252,7 +3242,7 @@ class Color(AllMixin, IntFlag):
self.assertEqual(Color.GREEN.value, 2)
self.assertEqual(Color.BLUE.value, 4)
self.assertEqual(Color.ALL.value, 7)
- self.assertEqual(str(Color.BLUE), 'Color.BLUE')
+ self.assertEqual(str(Color.BLUE), 'BLUE')
class Color(AllMixin, StrMixin, IntFlag):
RED = auto()
GREEN = auto()
@@ -3374,6 +3364,8 @@ class Sillier(IntEnum):
value = 4
+class TestEnumTypeSubclassing(unittest.TestCase):
+ pass
expected_help_output_with_docs = """\
Help on class Color in module %s:
@@ -3390,11 +3382,11 @@ class Color(enum.Enum)
|\x20\x20
| Data and other attributes defined here:
|\x20\x20
- | blue = <Color.blue: 3>
+ | blue = Color.blue
|\x20\x20
- | green = <Color.green: 2>
+ | green = Color.green
|\x20\x20
- | red = <Color.red: 1>
+ | red = Color.red
|\x20\x20
| ----------------------------------------------------------------------
| Data descriptors inherited from enum.Enum:
@@ -3406,7 +3398,7 @@ class Color(enum.Enum)
| The value of the Enum member.
|\x20\x20
| ----------------------------------------------------------------------
- | Readonly properties inherited from enum.EnumMeta:
+ | Readonly properties inherited from enum.EnumType:
|\x20\x20
| __members__
| Returns a mapping of member name->value.
@@ -3427,11 +3419,11 @@ class Color(enum.Enum)
|\x20\x20
| Data and other attributes defined here:
|\x20\x20
- | blue = <Color.blue: 3>
+ | blue = Color.blue
|\x20\x20
- | green = <Color.green: 2>
+ | green = Color.green
|\x20\x20
- | red = <Color.red: 1>
+ | red = Color.red
|\x20\x20
| ----------------------------------------------------------------------
| Data descriptors inherited from enum.Enum:
@@ -3441,7 +3433,7 @@ class Color(enum.Enum)
| value
|\x20\x20
| ----------------------------------------------------------------------
- | Data descriptors inherited from enum.EnumMeta:
+ | Data descriptors inherited from enum.EnumType:
|\x20\x20
| __members__"""
@@ -3468,7 +3460,7 @@ def test_pydoc(self):
def test_inspect_getmembers(self):
values = dict((
- ('__class__', EnumMeta),
+ ('__class__', EnumType),
('__doc__', 'An enumeration.'),
('__members__', self.Color.__members__),
('__module__', __name__),
@@ -3495,11 +3487,11 @@ def test_inspect_classify_class_attrs(self):
from inspect import Attribute
values = [
Attribute(name='__class__', kind='data',
- defining_class=object, object=EnumMeta),
+ defining_class=object, object=EnumType),
Attribute(name='__doc__', kind='data',
defining_class=self.Color, object='An enumeration.'),
Attribute(name='__members__', kind='property',
- defining_class=EnumMeta, object=EnumMeta.__members__),
+ defining_class=EnumType, object=EnumType.__members__),
Attribute(name='__module__', kind='data',
defining_class=self.Color, object=__name__),
Attribute(name='blue', kind='data',
@@ -3589,6 +3581,45 @@ def test_convert_raise(self):
('test.test_enum', '__main__')[__name__=='__main__'],
filter=lambda x: x.startswith('CONVERT_TEST_'))
+ def test_convert_repr_and_str(self):
+ module = ('test.test_enum', '__main__')[__name__=='__main__']
+ test_type = enum.IntEnum._convert_(
+ 'UnittestConvert',
+ module,
+ filter=lambda x: x.startswith('CONVERT_TEST_'))
+ self.assertEqual(repr(test_type.CONVERT_TEST_NAME_A), '%s.CONVERT_TEST_NAME_A' % module)
+ self.assertEqual(str(test_type.CONVERT_TEST_NAME_A), 'CONVERT_TEST_NAME_A')
+ self.assertEqual(format(test_type.CONVERT_TEST_NAME_A), '5')
+
+# global names for StrEnum._convert_ test
+CONVERT_STR_TEST_2 = 'goodbye'
+CONVERT_STR_TEST_1 = 'hello'
+
+class TestStrEnumConvert(unittest.TestCase):
+
+ def test_convert(self):
+ test_type = enum.StrEnum._convert_(
+ 'UnittestConvert',
+ ('test.test_enum', '__main__')[__name__=='__main__'],
+ filter=lambda x: x.startswith('CONVERT_STR_'))
+ # Ensure that test_type has all of the desired names and values.
+ self.assertEqual(test_type.CONVERT_STR_TEST_1, 'hello')
+ self.assertEqual(test_type.CONVERT_STR_TEST_2, 'goodbye')
+ # Ensure that test_type only picked up names matching the filter.
+ self.assertEqual([name for name in dir(test_type)
+ if name[0:2] not in ('CO', '__')],
+ [], msg='Names other than CONVERT_STR_* found.')
+
+ def test_convert_repr_and_str(self):
+ module = ('test.test_enum', '__main__')[__name__=='__main__']
+ test_type = enum.StrEnum._convert_(
+ 'UnittestConvert',
+ module,
+ filter=lambda x: x.startswith('CONVERT_STR_'))
+ self.assertEqual(repr(test_type.CONVERT_STR_TEST_1), '%s.CONVERT_STR_TEST_1' % module)
+ self.assertEqual(str(test_type.CONVERT_STR_TEST_2), 'goodbye')
+ self.assertEqual(format(test_type.CONVERT_STR_TEST_1), 'hello')
+
if __name__ == '__main__':
unittest.main()
diff --git a/Lib/test/test_pydoc.py b/Lib/test/test_pydoc.py
index 3bc0e9e6b53b1..61575b522a66b 100644
--- a/Lib/test/test_pydoc.py
+++ b/Lib/test/test_pydoc.py
@@ -453,7 +453,7 @@ class BinaryInteger(enum.IntEnum):
zero = 0
one = 1
doc = pydoc.render_doc(BinaryInteger)
- self.assertIn('<BinaryInteger.zero: 0>', doc)
+ self.assertIn('BinaryInteger.zero', doc)
def test_mixed_case_module_names_are_lower_cased(self):
# issue16484
diff --git a/Lib/test/test_signal.py b/Lib/test/test_signal.py
index f973d4fe08be3..8f943bedce395 100644
--- a/Lib/test/test_signal.py
+++ b/Lib/test/test_signal.py
@@ -872,7 +872,7 @@ def handler(signum, frame):
%s
- blocked = %s
+ blocked = %r
signum = signal.SIGALRM
# child: block and wait the signal
diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py
index bc280306b15d1..f91e00059daaa 100755
--- a/Lib/test/test_socket.py
+++ b/Lib/test/test_socket.py
@@ -1518,9 +1518,9 @@ def testGetaddrinfo(self):
infos = socket.getaddrinfo(HOST, 80, socket.AF_INET, socket.SOCK_STREAM)
for family, type, _, _, _ in infos:
self.assertEqual(family, socket.AF_INET)
- self.assertEqual(str(family), 'AddressFamily.AF_INET')
+ self.assertEqual(str(family), 'AF_INET')
self.assertEqual(type, socket.SOCK_STREAM)
- self.assertEqual(str(type), 'SocketKind.SOCK_STREAM')
+ self.assertEqual(str(type), 'SOCK_STREAM')
infos = socket.getaddrinfo(HOST, None, 0, socket.SOCK_STREAM)
for _, socktype, _, _, _ in infos:
self.assertEqual(socktype, socket.SOCK_STREAM)
@@ -1793,8 +1793,8 @@ def test_str_for_enums(self):
# Make sure that the AF_* and SOCK_* constants have enum-like string
# reprs.
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
- self.assertEqual(str(s.family), 'AddressFamily.AF_INET')
- self.assertEqual(str(s.type), 'SocketKind.SOCK_STREAM')
+ self.assertEqual(str(s.family), 'AF_INET')
+ self.assertEqual(str(s.type), 'SOCK_STREAM')
def test_socket_consistent_sock_type(self):
SOCK_NONBLOCK = getattr(socket, 'SOCK_NONBLOCK', 0)
diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py
index fa77406bca82a..4ef1fb8d63bb2 100644
--- a/Lib/test/test_ssl.py
+++ b/Lib/test/test_ssl.py
@@ -381,7 +381,7 @@ def test_str_for_enums(self):
# Make sure that the PROTOCOL_* constants have enum-like string
# reprs.
proto = ssl.PROTOCOL_TLS
- self.assertEqual(str(proto), '_SSLMethod.PROTOCOL_TLS')
+ self.assertEqual(str(proto), 'PROTOCOL_TLS')
ctx = ssl.SSLContext(proto)
self.assertIs(ctx.protocol, proto)
diff --git a/Lib/test/test_unicode.py b/Lib/test/test_unicode.py
index 42c77f0f4e868..d47cf28782dd7 100644
--- a/Lib/test/test_unicode.py
+++ b/Lib/test/test_unicode.py
@@ -1467,18 +1467,18 @@ class Str(str, enum.Enum):
ABC = 'abc'
# Testing Unicode formatting strings...
self.assertEqual("%s, %s" % (Str.ABC, Str.ABC),
- 'Str.ABC, Str.ABC')
+ 'ABC, ABC')
self.assertEqual("%s, %s, %d, %i, %u, %f, %5.2f" %
(Str.ABC, Str.ABC,
Int.IDES, Int.IDES, Int.IDES,
Float.PI, Float.PI),
- 'Str.ABC, Str.ABC, 15, 15, 15, 3.141593, 3.14')
+ 'ABC, ABC, 15, 15, 15, 3.141593, 3.14')
# formatting jobs delegated from the string implementation:
self.assertEqual('...%(foo)s...' % {'foo':Str.ABC},
- '...Str.ABC...')
+ '...ABC...')
self.assertEqual('...%(foo)s...' % {'foo':Int.IDES},
- '...Int.IDES...')
+ '...IDES...')
self.assertEqual('...%(foo)i...' % {'foo':Int.IDES},
'...15...')
self.assertEqual('...%(foo)d...' % {'foo':Int.IDES},
diff --git a/Misc/NEWS.d/next/Library/2020-09-23-21-58-34.bpo-40066.f1dr_5.rst b/Misc/NEWS.d/next/Library/2020-09-23-21-58-34.bpo-40066.f1dr_5.rst
new file mode 100644
index 0000000000000..6d2c68e2353dd
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2020-09-23-21-58-34.bpo-40066.f1dr_5.rst
@@ -0,0 +1,4 @@
+Enum's `repr()` and `str()` have changed: `repr()` is now *EnumClass.MemberName*
+and `str()` is *MemberName*. Additionally, stdlib Enum's whose contents are
+available as module attributes, such as `RegexFlag.IGNORECASE`, have their
+`repr()` as *module.name*, e.g. `re.IGNORECASE`.
diff --git a/Misc/NEWS.d/next/Library/2021-03-25-21-26-30.bpo-40066.7EBQ3_.rst b/Misc/NEWS.d/next/Library/2021-03-25-21-26-30.bpo-40066.7EBQ3_.rst
new file mode 100644
index 0000000000000..11903f8b9e93d
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2021-03-25-21-26-30.bpo-40066.7EBQ3_.rst
@@ -0,0 +1,3 @@
+Enum: adjust ``repr()`` to show only enum and member name (not value, nor
+angle brackets) and ``str()`` to show only member name. Update and improve
+documentation to match.
[View Less]
1
0

bpo-43399: Fix ElementTree.extend not working on iterators (GH-24751)
by miss-islington March 30, 2021
by miss-islington March 30, 2021
March 30, 2021
https://github.com/python/cpython/commit/b500bd8e672d15c6dfa24568a3264fdc0f…
commit: b500bd8e672d15c6dfa24568a3264fdc0f3e0c01
branch: 3.9
author: Miss Islington (bot) <31488909+miss-islington(a)users.noreply.github.com>
committer: miss-islington <31488909+miss-islington(a)users.noreply.github.com>
date: 2021-03-30T14:36:25-07:00
summary:
bpo-43399: Fix ElementTree.extend not working on iterators (GH-24751)
(cherry picked from commit 51a85ddce8b336addcb61b96f04c9c5edef07296)
Co-…
[View More]authored-by: Alex Prengère <2138730+alexprengere(a)users.noreply.github.com>
files:
A Misc/NEWS.d/next/Library/2021-03-04-17-53-46.bpo-43399.Wn95u-.rst
M Lib/test/test_xml_etree.py
M Lib/xml/etree/ElementTree.py
M Misc/ACKS
diff --git a/Lib/test/test_xml_etree.py b/Lib/test/test_xml_etree.py
index 5632b8b503cf3..bfc0d054ba8b7 100644
--- a/Lib/test/test_xml_etree.py
+++ b/Lib/test/test_xml_etree.py
@@ -312,6 +312,9 @@ def test_simpleops(self):
elem.extend([e])
self.serialize_check(elem, '<body><tag /><tag2 /></body>')
elem.remove(e)
+ elem.extend(iter([e]))
+ self.serialize_check(elem, '<body><tag /><tag2 /></body>')
+ elem.remove(e)
element = ET.Element("tag", key="value")
self.serialize_check(element, '<tag key="value" />') # 1
diff --git a/Lib/xml/etree/ElementTree.py b/Lib/xml/etree/ElementTree.py
index 7a269001d6e18..ac82ed8041995 100644
--- a/Lib/xml/etree/ElementTree.py
+++ b/Lib/xml/etree/ElementTree.py
@@ -252,7 +252,7 @@ def extend(self, elements):
"""
for element in elements:
self._assert_is_element(element)
- self._children.extend(elements)
+ self._children.append(element)
def insert(self, index, subelement):
"""Insert *subelement* at position *index*."""
diff --git a/Misc/ACKS b/Misc/ACKS
index 73d35c2d86bdc..4f7c92c9dc0f6 100644
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -1363,6 +1363,7 @@ Matheus Vieira Portela
Davin Potts
Guillaume Pratte
Florian Preinstorfer
+Alex Prengère
Amrit Prem
Paul Prescod
Donovan Preston
diff --git a/Misc/NEWS.d/next/Library/2021-03-04-17-53-46.bpo-43399.Wn95u-.rst b/Misc/NEWS.d/next/Library/2021-03-04-17-53-46.bpo-43399.Wn95u-.rst
new file mode 100644
index 0000000000000..0b8dffb2312e4
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2021-03-04-17-53-46.bpo-43399.Wn95u-.rst
@@ -0,0 +1,2 @@
+Fix ``ElementTree.extend`` not working on iterators when using the
+Python implementation
[View Less]
1
0

bpo-43399: Fix ElementTree.extend not working on iterators (GH-24751)
by miss-islington March 30, 2021
by miss-islington March 30, 2021
March 30, 2021
https://github.com/python/cpython/commit/c1079cde2a7676892a9b98703903206b7d…
commit: c1079cde2a7676892a9b98703903206b7d26ed1f
branch: 3.8
author: Miss Islington (bot) <31488909+miss-islington(a)users.noreply.github.com>
committer: miss-islington <31488909+miss-islington(a)users.noreply.github.com>
date: 2021-03-30T14:32:55-07:00
summary:
bpo-43399: Fix ElementTree.extend not working on iterators (GH-24751)
(cherry picked from commit 51a85ddce8b336addcb61b96f04c9c5edef07296)
Co-…
[View More]authored-by: Alex Prengère <2138730+alexprengere(a)users.noreply.github.com>
files:
A Misc/NEWS.d/next/Library/2021-03-04-17-53-46.bpo-43399.Wn95u-.rst
M Lib/test/test_xml_etree.py
M Lib/xml/etree/ElementTree.py
M Misc/ACKS
diff --git a/Lib/test/test_xml_etree.py b/Lib/test/test_xml_etree.py
index 341a3c7cd7660..d41ff4fd077e6 100644
--- a/Lib/test/test_xml_etree.py
+++ b/Lib/test/test_xml_etree.py
@@ -314,6 +314,9 @@ def test_simpleops(self):
elem.extend([e])
self.serialize_check(elem, '<body><tag /><tag2 /></body>')
elem.remove(e)
+ elem.extend(iter([e]))
+ self.serialize_check(elem, '<body><tag /><tag2 /></body>')
+ elem.remove(e)
element = ET.Element("tag", key="value")
self.serialize_check(element, '<tag key="value" />') # 1
diff --git a/Lib/xml/etree/ElementTree.py b/Lib/xml/etree/ElementTree.py
index 598b569ea958b..f8538dfb2b62d 100644
--- a/Lib/xml/etree/ElementTree.py
+++ b/Lib/xml/etree/ElementTree.py
@@ -245,7 +245,7 @@ def extend(self, elements):
"""
for element in elements:
self._assert_is_element(element)
- self._children.extend(elements)
+ self._children.append(element)
def insert(self, index, subelement):
"""Insert *subelement* at position *index*."""
diff --git a/Misc/ACKS b/Misc/ACKS
index e181c6171169e..39aa954a7b449 100644
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -1334,6 +1334,7 @@ Matheus Vieira Portela
Davin Potts
Guillaume Pratte
Florian Preinstorfer
+Alex Prengère
Amrit Prem
Paul Prescod
Donovan Preston
diff --git a/Misc/NEWS.d/next/Library/2021-03-04-17-53-46.bpo-43399.Wn95u-.rst b/Misc/NEWS.d/next/Library/2021-03-04-17-53-46.bpo-43399.Wn95u-.rst
new file mode 100644
index 0000000000000..0b8dffb2312e4
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2021-03-04-17-53-46.bpo-43399.Wn95u-.rst
@@ -0,0 +1,2 @@
+Fix ``ElementTree.extend`` not working on iterators when using the
+Python implementation
[View Less]
1
0

bpo-43399: Fix ElementTree.extend not working on iterators (GH-24751)
by serhiy-storchaka March 30, 2021
by serhiy-storchaka March 30, 2021
March 30, 2021
https://github.com/python/cpython/commit/51a85ddce8b336addcb61b96f04c9c5ede…
commit: 51a85ddce8b336addcb61b96f04c9c5edef07296
branch: master
author: Alex Prengère <2138730+alexprengere(a)users.noreply.github.com>
committer: serhiy-storchaka <storchaka(a)gmail.com>
date: 2021-03-31T00:11:29+03:00
summary:
bpo-43399: Fix ElementTree.extend not working on iterators (GH-24751)
files:
A Misc/NEWS.d/next/Library/2021-03-04-17-53-46.bpo-43399.Wn95u-.rst
M Lib/test/test_xml_etree.py
M Lib/…
[View More]xml/etree/ElementTree.py
M Misc/ACKS
diff --git a/Lib/test/test_xml_etree.py b/Lib/test/test_xml_etree.py
index fcb1f7fdfbbde..553529a300170 100644
--- a/Lib/test/test_xml_etree.py
+++ b/Lib/test/test_xml_etree.py
@@ -330,6 +330,9 @@ def test_simpleops(self):
elem.extend([e])
self.serialize_check(elem, '<body><tag /><tag2 /></body>')
elem.remove(e)
+ elem.extend(iter([e]))
+ self.serialize_check(elem, '<body><tag /><tag2 /></body>')
+ elem.remove(e)
element = ET.Element("tag", key="value")
self.serialize_check(element, '<tag key="value" />') # 1
diff --git a/Lib/xml/etree/ElementTree.py b/Lib/xml/etree/ElementTree.py
index 168418e466c45..99246800b9866 100644
--- a/Lib/xml/etree/ElementTree.py
+++ b/Lib/xml/etree/ElementTree.py
@@ -252,7 +252,7 @@ def extend(self, elements):
"""
for element in elements:
self._assert_is_element(element)
- self._children.extend(elements)
+ self._children.append(element)
def insert(self, index, subelement):
"""Insert *subelement* at position *index*."""
diff --git a/Misc/ACKS b/Misc/ACKS
index 5d3f75a4165b1..42f0efdd536dd 100644
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -1381,6 +1381,7 @@ Matheus Vieira Portela
Davin Potts
Guillaume Pratte
Florian Preinstorfer
+Alex Prengère
Amrit Prem
Paul Prescod
Donovan Preston
diff --git a/Misc/NEWS.d/next/Library/2021-03-04-17-53-46.bpo-43399.Wn95u-.rst b/Misc/NEWS.d/next/Library/2021-03-04-17-53-46.bpo-43399.Wn95u-.rst
new file mode 100644
index 0000000000000..0b8dffb2312e4
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2021-03-04-17-53-46.bpo-43399.Wn95u-.rst
@@ -0,0 +1,2 @@
+Fix ``ElementTree.extend`` not working on iterators when using the
+Python implementation
[View Less]
1
0

bpo-41369: Finish updating the vendored libmpdec to version 2.5.1 (GH-24962)
by pitrou March 30, 2021
by pitrou March 30, 2021
March 30, 2021
https://github.com/python/cpython/commit/73b20ae2fb7a5c1374aa5c3719f64c53d2…
commit: 73b20ae2fb7a5c1374aa5c3719f64c53d29fa0d2
branch: master
author: Antoine Pitrou <antoine(a)python.org>
committer: pitrou <pitrou(a)free.fr>
date: 2021-03-30T18:11:06+02:00
summary:
bpo-41369: Finish updating the vendored libmpdec to version 2.5.1 (GH-24962)
Complete the update to libmpdec-2.5.1.
Co-authored-by: Stefan Krah <skrah(a)bytereef.org>
files:
A Misc/NEWS.d/next/Library/2021-03-21-…
[View More]17-50-42.bpo-41369.-fpmYZ.rst
A Modules/_decimal/libmpdec/bench.c
A Modules/_decimal/libmpdec/bench_full.c
A Modules/_decimal/libmpdec/examples/README.txt
A Modules/_decimal/libmpdec/examples/compare.c
A Modules/_decimal/libmpdec/examples/div.c
A Modules/_decimal/libmpdec/examples/divmod.c
A Modules/_decimal/libmpdec/examples/multiply.c
A Modules/_decimal/libmpdec/examples/pow.c
A Modules/_decimal/libmpdec/examples/powmod.c
A Modules/_decimal/libmpdec/examples/shift.c
A Modules/_decimal/libmpdec/examples/sqrt.c
A Modules/_decimal/libmpdec/mpsignal.c
D Modules/_decimal/libmpdec/vccompat.h
M Modules/_decimal/_decimal.c
M Modules/_decimal/libmpdec/README.txt
M Modules/_decimal/libmpdec/constants.c
M Modules/_decimal/libmpdec/context.c
M Modules/_decimal/libmpdec/crt.c
M Modules/_decimal/libmpdec/crt.h
M Modules/_decimal/libmpdec/io.c
M Modules/_decimal/libmpdec/mpalloc.c
M Modules/_decimal/libmpdec/mpalloc.h
M Modules/_decimal/libmpdec/mpdecimal.c
M Modules/_decimal/libmpdec/mpdecimal.h
M Modules/_decimal/libmpdec/typearith.h
M setup.py
diff --git a/Misc/NEWS.d/next/Library/2021-03-21-17-50-42.bpo-41369.-fpmYZ.rst b/Misc/NEWS.d/next/Library/2021-03-21-17-50-42.bpo-41369.-fpmYZ.rst
new file mode 100644
index 0000000000000..6a85e8259cef4
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2021-03-21-17-50-42.bpo-41369.-fpmYZ.rst
@@ -0,0 +1,2 @@
+Finish updating the vendored libmpdec to version 2.5.1. Patch by Stefan
+Krah.
diff --git a/Modules/_decimal/_decimal.c b/Modules/_decimal/_decimal.c
index 83e237d02bf5a..9a4329f494f31 100644
--- a/Modules/_decimal/_decimal.c
+++ b/Modules/_decimal/_decimal.c
@@ -3293,7 +3293,7 @@ dec_format(PyObject *dec, PyObject *args)
}
else {
size_t n = strlen(spec.dot);
- if (n > 1 || (n == 1 && !isascii((uchar)spec.dot[0]))) {
+ if (n > 1 || (n == 1 && !isascii((unsigned char)spec.dot[0]))) {
/* fix locale dependent non-ascii characters */
dot = dotsep_as_utf8(spec.dot);
if (dot == NULL) {
@@ -3302,7 +3302,7 @@ dec_format(PyObject *dec, PyObject *args)
spec.dot = PyBytes_AS_STRING(dot);
}
n = strlen(spec.sep);
- if (n > 1 || (n == 1 && !isascii((uchar)spec.sep[0]))) {
+ if (n > 1 || (n == 1 && !isascii((unsigned char)spec.sep[0]))) {
/* fix locale dependent non-ascii characters */
sep = dotsep_as_utf8(spec.sep);
if (sep == NULL) {
diff --git a/Modules/_decimal/libmpdec/README.txt b/Modules/_decimal/libmpdec/README.txt
index dc97820a6eb0c..c1d481dee7645 100644
--- a/Modules/_decimal/libmpdec/README.txt
+++ b/Modules/_decimal/libmpdec/README.txt
@@ -29,7 +29,6 @@ Files required for the Python _decimal module
Visual Studio only:
~~~~~~~~~~~~~~~~~~~
- vccompat.h -> snprintf <==> sprintf_s and similar things.
vcdiv64.asm -> Double word division used in typearith.h. VS 2008 does
not allow inline asm for x64. Also, it does not provide
an intrinsic for double word division.
diff --git a/Modules/_decimal/libmpdec/bench.c b/Modules/_decimal/libmpdec/bench.c
new file mode 100644
index 0000000000000..09138f4ce9c03
--- /dev/null
+++ b/Modules/_decimal/libmpdec/bench.c
@@ -0,0 +1,137 @@
+/*
+ * Copyright (c) 2008-2020 Stefan Krah. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+
+#include "mpdecimal.h"
+
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <time.h>
+
+
+static void
+err_exit(const char *msg)
+{
+ fprintf(stderr, "%s\n", msg);
+ exit(1);
+}
+
+static mpd_t *
+new_mpd(void)
+{
+ mpd_t *x = mpd_qnew();
+ if (x == NULL) {
+ err_exit("out of memory");
+ }
+
+ return x;
+}
+
+/* Nonsense version of escape-time algorithm for calculating a mandelbrot
+ * set. Just for benchmarking. */
+static void
+color_point(mpd_t *x0, mpd_t *y0, long maxiter, mpd_context_t *ctx)
+{
+ mpd_t *x, *y, *sq_x, *sq_y;
+ mpd_t *two;
+
+ x = new_mpd();
+ y = new_mpd();
+ mpd_set_u32(x, 0, ctx);
+ mpd_set_u32(y, 0, ctx);
+
+ sq_x = new_mpd();
+ sq_y = new_mpd();
+ mpd_set_u32(sq_x, 0, ctx);
+ mpd_set_u32(sq_y, 0, ctx);
+
+ two = new_mpd();
+ mpd_set_u32(two, 2, ctx);
+
+ for (long i = 0; i < maxiter; i++) {
+ mpd_mul(y, x, y, ctx);
+ mpd_mul(y, y, two, ctx);
+ mpd_add(y, y, y0, ctx);
+
+ mpd_sub(x, sq_x, sq_y, ctx);
+ mpd_add(x, x, x0, ctx);
+
+ mpd_mul(sq_x, x, x, ctx);
+ mpd_mul(sq_y, y, y, ctx);
+ }
+
+ mpd_copy(x0, x, ctx);
+
+ mpd_del(two);
+ mpd_del(sq_y);
+ mpd_del(sq_x);
+ mpd_del(y);
+ mpd_del(x);
+}
+
+
+int
+main(int argc, char **argv)
+{
+ mpd_context_t ctx;
+ mpd_t *x0, *y0;
+ uint32_t prec = 19;
+ long iter = 10000000;
+ clock_t start_clock, end_clock;
+
+ if (argc != 3) {
+ err_exit("usage: bench prec iter\n");
+ }
+ prec = strtoul(argv[1], NULL, 10);
+ iter = strtol(argv[2], NULL, 10);
+
+ mpd_init(&ctx, prec);
+ /* no more MPD_MINALLOC changes after here */
+
+ x0 = new_mpd();
+ y0 = new_mpd();
+ mpd_set_string(x0, "0.222", &ctx);
+ mpd_set_string(y0, "0.333", &ctx);
+ if (ctx.status & MPD_Errors) {
+ mpd_del(y0);
+ mpd_del(x0);
+ err_exit("unexpected error during conversion");
+ }
+
+ start_clock = clock();
+ color_point(x0, y0, iter, &ctx);
+ end_clock = clock();
+
+ mpd_print(x0);
+ fprintf(stderr, "time: %f\n\n", (double)(end_clock-start_clock)/(double)CLOCKS_PER_SEC);
+
+ mpd_del(y0);
+ mpd_del(x0);
+
+ return 0;
+}
diff --git a/Modules/_decimal/libmpdec/bench_full.c b/Modules/_decimal/libmpdec/bench_full.c
new file mode 100644
index 0000000000000..6ab73917e1c32
--- /dev/null
+++ b/Modules/_decimal/libmpdec/bench_full.c
@@ -0,0 +1,193 @@
+/*
+ * Copyright (c) 2008-2020 Stefan Krah. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+
+#include "mpdecimal.h"
+
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <time.h>
+
+
+static void
+err_exit(const char *msg)
+{
+ fprintf(stderr, "%s\n", msg);
+ exit(1);
+}
+
+static mpd_t *
+new_mpd(void)
+{
+ mpd_t *x = mpd_qnew();
+ if (x == NULL) {
+ err_exit("out of memory");
+ }
+
+ return x;
+}
+
+/*
+ * Example from: http://en.wikipedia.org/wiki/Mandelbrot_set
+ *
+ * Escape time algorithm for drawing the set:
+ *
+ * Point x0, y0 is deemed to be in the Mandelbrot set if the return
+ * value is maxiter. Lower return values indicate how quickly points
+ * escaped and can be used for coloring.
+ */
+static int
+color_point(const mpd_t *x0, const mpd_t *y0, const long maxiter, mpd_context_t *ctx)
+{
+ mpd_t *x, *y, *sq_x, *sq_y;
+ mpd_t *two, *four, *c;
+ long i;
+
+ x = new_mpd();
+ y = new_mpd();
+ mpd_set_u32(x, 0, ctx);
+ mpd_set_u32(y, 0, ctx);
+
+ sq_x = new_mpd();
+ sq_y = new_mpd();
+ mpd_set_u32(sq_x, 0, ctx);
+ mpd_set_u32(sq_y, 0, ctx);
+
+ two = new_mpd();
+ four = new_mpd();
+ mpd_set_u32(two, 2, ctx);
+ mpd_set_u32(four, 4, ctx);
+
+ c = new_mpd();
+ mpd_set_u32(c, 0, ctx);
+
+ for (i = 0; i < maxiter && mpd_cmp(c, four, ctx) <= 0; i++) {
+ mpd_mul(y, x, y, ctx);
+ mpd_mul(y, y, two, ctx);
+ mpd_add(y, y, y0, ctx);
+
+ mpd_sub(x, sq_x, sq_y, ctx);
+ mpd_add(x, x, x0, ctx);
+
+ mpd_mul(sq_x, x, x, ctx);
+ mpd_mul(sq_y, y, y, ctx);
+ mpd_add(c, sq_x, sq_y, ctx);
+ }
+
+ mpd_del(c);
+ mpd_del(four);
+ mpd_del(two);
+ mpd_del(sq_y);
+ mpd_del(sq_x);
+ mpd_del(y);
+ mpd_del(x);
+
+ return i;
+}
+
+int
+main(int argc, char **argv)
+{
+ mpd_context_t ctx;
+ mpd_t *x0, *y0;
+ mpd_t *sqrt_2, *xstep, *ystep;
+ mpd_ssize_t prec = 19;
+
+ long iter = 1000;
+ int points[40][80];
+ int i, j;
+ clock_t start_clock, end_clock;
+
+
+ if (argc != 3) {
+ fprintf(stderr, "usage: ./bench prec iter\n");
+ exit(1);
+ }
+ prec = strtoll(argv[1], NULL, 10);
+ iter = strtol(argv[2], NULL, 10);
+
+ mpd_init(&ctx, prec);
+ /* no more MPD_MINALLOC changes after here */
+
+ sqrt_2 = new_mpd();
+ xstep = new_mpd();
+ ystep = new_mpd();
+ x0 = new_mpd();
+ y0 = new_mpd();
+
+ mpd_set_u32(sqrt_2, 2, &ctx);
+ mpd_sqrt(sqrt_2, sqrt_2, &ctx);
+ mpd_div_u32(xstep, sqrt_2, 40, &ctx);
+ mpd_div_u32(ystep, sqrt_2, 20, &ctx);
+
+ start_clock = clock();
+ mpd_copy(y0, sqrt_2, &ctx);
+ for (i = 0; i < 40; i++) {
+ mpd_copy(x0, sqrt_2, &ctx);
+ mpd_set_negative(x0);
+ for (j = 0; j < 80; j++) {
+ points[i][j] = color_point(x0, y0, iter, &ctx);
+ mpd_add(x0, x0, xstep, &ctx);
+ }
+ mpd_sub(y0, y0, ystep, &ctx);
+ }
+ end_clock = clock();
+
+#ifdef BENCH_VERBOSE
+ for (i = 0; i < 40; i++) {
+ for (j = 0; j < 80; j++) {
+ if (points[i][j] == iter) {
+ putchar('*');
+ }
+ else if (points[i][j] >= 10) {
+ putchar('+');
+ }
+ else if (points[i][j] >= 5) {
+ putchar('.');
+ }
+ else {
+ putchar(' ');
+ }
+ }
+ putchar('\n');
+ }
+ putchar('\n');
+#else
+ (void)points; /* suppress gcc warning */
+#endif
+
+ printf("time: %f\n\n", (double)(end_clock-start_clock)/(double)CLOCKS_PER_SEC);
+
+ mpd_del(y0);
+ mpd_del(x0);
+ mpd_del(ystep);
+ mpd_del(xstep);
+ mpd_del(sqrt_2);
+
+ return 0;
+}
diff --git a/Modules/_decimal/libmpdec/constants.c b/Modules/_decimal/libmpdec/constants.c
index 4c4de622bc601..ed074fa81c6d2 100644
--- a/Modules/_decimal/libmpdec/constants.c
+++ b/Modules/_decimal/libmpdec/constants.c
@@ -27,6 +27,7 @@
#include "mpdecimal.h"
+#include "basearith.h"
#include "constants.h"
@@ -111,7 +112,7 @@
#error "CONFIG_64 or CONFIG_32 must be defined."
#endif
-const char *mpd_round_string[MPD_ROUND_GUARD] = {
+const char * const mpd_round_string[MPD_ROUND_GUARD] = {
"ROUND_UP", /* round away from 0 */
"ROUND_DOWN", /* round toward 0 (truncate) */
"ROUND_CEILING", /* round toward +infinity */
@@ -123,7 +124,7 @@ const char *mpd_round_string[MPD_ROUND_GUARD] = {
"ROUND_TRUNC", /* truncate, but set infinity */
};
-const char *mpd_clamp_string[MPD_CLAMP_GUARD] = {
+const char * const mpd_clamp_string[MPD_CLAMP_GUARD] = {
"CLAMP_DEFAULT",
"CLAMP_IEEE_754"
};
diff --git a/Modules/_decimal/libmpdec/context.c b/Modules/_decimal/libmpdec/context.c
index 9cbc20509595d..172794b67d800 100644
--- a/Modules/_decimal/libmpdec/context.c
+++ b/Modules/_decimal/libmpdec/context.c
@@ -235,12 +235,12 @@ mpd_qsetround(mpd_context_t *ctx, int round)
}
int
-mpd_qsettraps(mpd_context_t *ctx, uint32_t traps)
+mpd_qsettraps(mpd_context_t *ctx, uint32_t flags)
{
- if (traps > MPD_Max_status) {
+ if (flags > MPD_Max_status) {
return 0;
}
- ctx->traps = traps;
+ ctx->traps = flags;
return 1;
}
diff --git a/Modules/_decimal/libmpdec/crt.c b/Modules/_decimal/libmpdec/crt.c
index 613274ee0c5b5..babcce41bf67c 100644
--- a/Modules/_decimal/libmpdec/crt.c
+++ b/Modules/_decimal/libmpdec/crt.c
@@ -33,8 +33,8 @@
#include "constants.h"
#include "crt.h"
#include "numbertheory.h"
-#include "umodarith.h"
#include "typearith.h"
+#include "umodarith.h"
/* Bignum: Chinese Remainder Theorem, extends the maximum transform length. */
@@ -62,17 +62,17 @@ static inline void
_crt_add3(mpd_uint_t w[3], mpd_uint_t v[3])
{
mpd_uint_t carry;
- mpd_uint_t s;
- s = w[0] + v[0];
- carry = (s < w[0]);
- w[0] = s;
+ w[0] = w[0] + v[0];
+ carry = (w[0] < v[0]);
+
+ w[1] = w[1] + v[1];
+ if (w[1] < v[1]) w[2]++;
- s = w[1] + (v[1] + carry);
- carry = (s < w[1]);
- w[1] = s;
+ w[1] = w[1] + carry;
+ if (w[1] < carry) w[2]++;
- w[2] = w[2] + (v[2] + carry);
+ w[2] += v[2];
}
/* Divide 3 words in u by v, store result in w, return remainder. */
diff --git a/Modules/_decimal/libmpdec/crt.h b/Modules/_decimal/libmpdec/crt.h
index 15a347d4cb31e..ed66753c2510b 100644
--- a/Modules/_decimal/libmpdec/crt.h
+++ b/Modules/_decimal/libmpdec/crt.h
@@ -37,7 +37,7 @@
MPD_PRAGMA(MPD_HIDE_SYMBOLS_START)
-void crt3(mpd_uint_t *x1, mpd_uint_t *x2, mpd_uint_t *x3, mpd_size_t nmemb);
+void crt3(mpd_uint_t *x1, mpd_uint_t *x2, mpd_uint_t *x3, mpd_size_t rsize);
MPD_PRAGMA(MPD_HIDE_SYMBOLS_END) /* restore previous scope rules */
diff --git a/Modules/_decimal/libmpdec/examples/README.txt b/Modules/_decimal/libmpdec/examples/README.txt
new file mode 100644
index 0000000000000..69615b45f9821
--- /dev/null
+++ b/Modules/_decimal/libmpdec/examples/README.txt
@@ -0,0 +1,8 @@
+
+
+This directory contains a number of examples. In order to compile, run
+(for example):
+
+gcc -Wall -W -O2 -o powmod powmod.c -lmpdec -lm
+
+
diff --git a/Modules/_decimal/libmpdec/examples/compare.c b/Modules/_decimal/libmpdec/examples/compare.c
new file mode 100644
index 0000000000000..9051773e116de
--- /dev/null
+++ b/Modules/_decimal/libmpdec/examples/compare.c
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2008-2020 Stefan Krah. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <time.h>
+#include <mpdecimal.h>
+
+
+int
+main(int argc, char **argv)
+{
+ mpd_context_t ctx;
+ mpd_t *a, *b;
+ mpd_t *result;
+ char *rstring;
+ char status_str[MPD_MAX_FLAG_STRING];
+ clock_t start_clock, end_clock;
+
+ if (argc != 3) {
+ fprintf(stderr, "compare: usage: ./compare x y\n");
+ exit(1);
+ }
+
+ mpd_init(&ctx, 38);
+ ctx.traps = 0;
+
+ result = mpd_new(&ctx);
+ a = mpd_new(&ctx);
+ b = mpd_new(&ctx);
+ mpd_set_string(a, argv[1], &ctx);
+ mpd_set_string(b, argv[2], &ctx);
+
+ start_clock = clock();
+ mpd_compare(result, a, b, &ctx);
+ end_clock = clock();
+ fprintf(stderr, "time: %f\n\n",
+ (double)(end_clock-start_clock)/(double)CLOCKS_PER_SEC);
+
+ rstring = mpd_to_sci(result, 1);
+ mpd_snprint_flags(status_str, MPD_MAX_FLAG_STRING, ctx.status);
+ printf("%s %s\n", rstring, status_str);
+
+ mpd_del(a);
+ mpd_del(b);
+ mpd_del(result);
+ mpd_free(rstring);
+
+ return 0;
+}
+
+
diff --git a/Modules/_decimal/libmpdec/examples/div.c b/Modules/_decimal/libmpdec/examples/div.c
new file mode 100644
index 0000000000000..b76037d2a64c6
--- /dev/null
+++ b/Modules/_decimal/libmpdec/examples/div.c
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2008-2020 Stefan Krah. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <time.h>
+#include <mpdecimal.h>
+
+
+int
+main(int argc, char **argv)
+{
+ mpd_context_t ctx;
+ mpd_t *a, *b;
+ mpd_t *result;
+ char *rstring;
+ char status_str[MPD_MAX_FLAG_STRING];
+ clock_t start_clock, end_clock;
+
+ if (argc != 3) {
+ fprintf(stderr, "div: usage: ./div x y\n");
+ exit(1);
+ }
+
+ mpd_init(&ctx, 38);
+ ctx.traps = 0;
+
+ result = mpd_new(&ctx);
+ a = mpd_new(&ctx);
+ b = mpd_new(&ctx);
+ mpd_set_string(a, argv[1], &ctx);
+ mpd_set_string(b, argv[2], &ctx);
+
+ start_clock = clock();
+ mpd_div(result, a, b, &ctx);
+ end_clock = clock();
+ fprintf(stderr, "time: %f\n\n",
+ (double)(end_clock-start_clock)/(double)CLOCKS_PER_SEC);
+
+ rstring = mpd_to_sci(result, 1);
+ mpd_snprint_flags(status_str, MPD_MAX_FLAG_STRING, ctx.status);
+ printf("%s %s\n", rstring, status_str);
+
+ mpd_del(a);
+ mpd_del(b);
+ mpd_del(result);
+ mpd_free(rstring);
+
+ return 0;
+}
+
+
diff --git a/Modules/_decimal/libmpdec/examples/divmod.c b/Modules/_decimal/libmpdec/examples/divmod.c
new file mode 100644
index 0000000000000..1f2b48306d6d0
--- /dev/null
+++ b/Modules/_decimal/libmpdec/examples/divmod.c
@@ -0,0 +1,82 @@
+/*
+ * Copyright (c) 2008-2020 Stefan Krah. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <time.h>
+#include <mpdecimal.h>
+
+
+int
+main(int argc, char **argv)
+{
+ mpd_context_t ctx;
+ mpd_t *a, *b;
+ mpd_t *q, *r;
+ char *qs, *rs;
+ char status_str[MPD_MAX_FLAG_STRING];
+ clock_t start_clock, end_clock;
+
+ if (argc != 3) {
+ fprintf(stderr, "divmod: usage: ./divmod x y\n");
+ exit(1);
+ }
+
+ mpd_init(&ctx, 38);
+ ctx.traps = 0;
+
+ q = mpd_new(&ctx);
+ r = mpd_new(&ctx);
+ a = mpd_new(&ctx);
+ b = mpd_new(&ctx);
+ mpd_set_string(a, argv[1], &ctx);
+ mpd_set_string(b, argv[2], &ctx);
+
+ start_clock = clock();
+ mpd_divmod(q, r, a, b, &ctx);
+ end_clock = clock();
+ fprintf(stderr, "time: %f\n\n",
+ (double)(end_clock-start_clock)/(double)CLOCKS_PER_SEC);
+
+ qs = mpd_to_sci(q, 1);
+ rs = mpd_to_sci(r, 1);
+
+ mpd_snprint_flags(status_str, MPD_MAX_FLAG_STRING, ctx.status);
+ printf("%s %s %s\n", qs, rs, status_str);
+
+ mpd_del(q);
+ mpd_del(r);
+ mpd_del(a);
+ mpd_del(b);
+ mpd_free(qs);
+ mpd_free(rs);
+
+ return 0;
+}
+
+
diff --git a/Modules/_decimal/libmpdec/examples/multiply.c b/Modules/_decimal/libmpdec/examples/multiply.c
new file mode 100644
index 0000000000000..7f2687d15f827
--- /dev/null
+++ b/Modules/_decimal/libmpdec/examples/multiply.c
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2008-2020 Stefan Krah. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <time.h>
+#include <mpdecimal.h>
+
+
+int
+main(int argc, char **argv)
+{
+ mpd_context_t ctx;
+ mpd_t *a, *b;
+ mpd_t *result;
+ char *rstring;
+ char status_str[MPD_MAX_FLAG_STRING];
+ clock_t start_clock, end_clock;
+
+ if (argc != 3) {
+ fprintf(stderr, "multiply: usage: ./multiply x y\n");
+ exit(1);
+ }
+
+ mpd_init(&ctx, 38);
+ ctx.traps = 0;
+
+ result = mpd_new(&ctx);
+ a = mpd_new(&ctx);
+ b = mpd_new(&ctx);
+ mpd_set_string(a, argv[1], &ctx);
+ mpd_set_string(b, argv[2], &ctx);
+
+ start_clock = clock();
+ mpd_mul(result, a, b, &ctx);
+ end_clock = clock();
+ fprintf(stderr, "time: %f\n\n",
+ (double)(end_clock-start_clock)/(double)CLOCKS_PER_SEC);
+
+ rstring = mpd_to_sci(result, 1);
+ mpd_snprint_flags(status_str, MPD_MAX_FLAG_STRING, ctx.status);
+ printf("%s %s\n", rstring, status_str);
+
+ mpd_del(a);
+ mpd_del(b);
+ mpd_del(result);
+ mpd_free(rstring);
+
+ return 0;
+}
+
+
diff --git a/Modules/_decimal/libmpdec/examples/pow.c b/Modules/_decimal/libmpdec/examples/pow.c
new file mode 100644
index 0000000000000..628c143427357
--- /dev/null
+++ b/Modules/_decimal/libmpdec/examples/pow.c
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2008-2020 Stefan Krah. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <time.h>
+#include <mpdecimal.h>
+
+
+int
+main(int argc, char **argv)
+{
+ mpd_context_t ctx;
+ mpd_t *a, *b;
+ mpd_t *result;
+ char *rstring;
+ char status_str[MPD_MAX_FLAG_STRING];
+ clock_t start_clock, end_clock;
+
+ if (argc != 3) {
+ fprintf(stderr, "pow: usage: ./pow x y\n");
+ exit(1);
+ }
+
+ mpd_init(&ctx, 38);
+ ctx.traps = 0;
+
+ result = mpd_new(&ctx);
+ a = mpd_new(&ctx);
+ b = mpd_new(&ctx);
+ mpd_set_string(a, argv[1], &ctx);
+ mpd_set_string(b, argv[2], &ctx);
+
+ start_clock = clock();
+ mpd_pow(result, a, b, &ctx);
+ end_clock = clock();
+ fprintf(stderr, "time: %f\n\n",
+ (double)(end_clock-start_clock)/(double)CLOCKS_PER_SEC);
+
+ rstring = mpd_to_sci(result, 1);
+ mpd_snprint_flags(status_str, MPD_MAX_FLAG_STRING, ctx.status);
+ printf("%s %s\n", rstring, status_str);
+
+ mpd_del(a);
+ mpd_del(b);
+ mpd_del(result);
+ mpd_free(rstring);
+
+ return 0;
+}
+
+
diff --git a/Modules/_decimal/libmpdec/examples/powmod.c b/Modules/_decimal/libmpdec/examples/powmod.c
new file mode 100644
index 0000000000000..b422fdbbb955d
--- /dev/null
+++ b/Modules/_decimal/libmpdec/examples/powmod.c
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2008-2020 Stefan Krah. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <time.h>
+#include <mpdecimal.h>
+
+
+int
+main(int argc, char **argv)
+{
+ mpd_context_t ctx;
+ mpd_t *a, *b, *c;
+ mpd_t *result;
+ char *rstring;
+ char status_str[MPD_MAX_FLAG_STRING];
+ clock_t start_clock, end_clock;
+
+ if (argc != 4) {
+ fprintf(stderr, "powmod: usage: ./powmod x y z\n");
+ exit(1);
+ }
+
+ mpd_init(&ctx, 38);
+ ctx.traps = 0;
+
+ result = mpd_new(&ctx);
+ a = mpd_new(&ctx);
+ b = mpd_new(&ctx);
+ c = mpd_new(&ctx);
+ mpd_set_string(a, argv[1], &ctx);
+ mpd_set_string(b, argv[2], &ctx);
+ mpd_set_string(c, argv[3], &ctx);
+
+ start_clock = clock();
+ mpd_powmod(result, a, b, c, &ctx);
+ end_clock = clock();
+ fprintf(stderr, "time: %f\n\n",
+ (double)(end_clock-start_clock)/(double)CLOCKS_PER_SEC);
+
+ rstring = mpd_to_sci(result, 1);
+ mpd_snprint_flags(status_str, MPD_MAX_FLAG_STRING, ctx.status);
+ printf("%s %s\n", rstring, status_str);
+
+ mpd_del(a);
+ mpd_del(b);
+ mpd_del(c);
+ mpd_del(result);
+ mpd_free(rstring);
+
+ return 0;
+}
+
+
diff --git a/Modules/_decimal/libmpdec/examples/shift.c b/Modules/_decimal/libmpdec/examples/shift.c
new file mode 100644
index 0000000000000..6d54e108ca87f
--- /dev/null
+++ b/Modules/_decimal/libmpdec/examples/shift.c
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2008-2020 Stefan Krah. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <time.h>
+#include <mpdecimal.h>
+
+
+int
+main(int argc, char **argv)
+{
+ mpd_context_t ctx;
+ mpd_t *a, *b;
+ mpd_t *result;
+ char *rstring;
+ char status_str[MPD_MAX_FLAG_STRING];
+ clock_t start_clock, end_clock;
+
+ if (argc != 3) {
+ fprintf(stderr, "shift: usage: ./shift x y\n");
+ exit(1);
+ }
+
+ mpd_init(&ctx, 38);
+ ctx.traps = 0;
+
+ result = mpd_new(&ctx);
+ a = mpd_new(&ctx);
+ b = mpd_new(&ctx);
+ mpd_set_string(a, argv[1], &ctx);
+ mpd_set_string(b, argv[2], &ctx);
+
+ start_clock = clock();
+ mpd_shift(result, a, b, &ctx);
+ end_clock = clock();
+ fprintf(stderr, "time: %f\n\n",
+ (double)(end_clock-start_clock)/(double)CLOCKS_PER_SEC);
+
+ rstring = mpd_to_sci(result, 1);
+ mpd_snprint_flags(status_str, MPD_MAX_FLAG_STRING, ctx.status);
+ printf("%s %s\n", rstring, status_str);
+
+ mpd_del(a);
+ mpd_del(b);
+ mpd_del(result);
+ mpd_free(rstring);
+
+ return 0;
+}
+
+
diff --git a/Modules/_decimal/libmpdec/vccompat.h b/Modules/_decimal/libmpdec/examples/sqrt.c
similarity index 62%
rename from Modules/_decimal/libmpdec/vccompat.h
rename to Modules/_decimal/libmpdec/examples/sqrt.c
index e2e1c42cc0250..d8272789b18c2 100644
--- a/Modules/_decimal/libmpdec/vccompat.h
+++ b/Modules/_decimal/libmpdec/examples/sqrt.c
@@ -26,31 +26,49 @@
*/
-#ifndef LIBMPDEC_VCCOMPAT_H_
-#define LIBMPDEC_VCCOMPAT_H_
-
-
-/* Visual C fixes: no snprintf ... */
-#ifdef _MSC_VER
- #ifndef __cplusplus
- #undef inline
- #define inline __inline
- #endif
- #undef random
- #define random rand
- #undef srandom
- #define srandom srand
- #undef snprintf
- #define snprintf sprintf_s
- #define HAVE_SNPRINTF
- #undef strncasecmp
- #define strncasecmp _strnicmp
- #undef strcasecmp
- #define strcasecmp _stricmp
- #undef strtoll
- #define strtoll _strtoi64
- #define strdup _strdup
-#endif
-
-
-#endif /* LIBMPDEC_VCCOMPAT_H_ */
+#include <stdio.h>
+#include <stdlib.h>
+#include <time.h>
+#include <mpdecimal.h>
+
+
+int
+main(int argc, char **argv)
+{
+ mpd_context_t ctx;
+ mpd_t *a;
+ mpd_t *result;
+ char *rstring;
+ char status_str[MPD_MAX_FLAG_STRING];
+ clock_t start_clock, end_clock;
+
+ if (argc != 2) {
+ fprintf(stderr, "sqrt: usage: ./sqrt x\n");
+ exit(1);
+ }
+
+ mpd_init(&ctx, 38);
+ ctx.traps = 0;
+
+ result = mpd_new(&ctx);
+ a = mpd_new(&ctx);
+ mpd_set_string(a, argv[1], &ctx);
+
+ start_clock = clock();
+ mpd_sqrt(result, a, &ctx);
+ end_clock = clock();
+ fprintf(stderr, "time: %f\n\n",
+ (double)(end_clock-start_clock)/(double)CLOCKS_PER_SEC);
+
+ rstring = mpd_to_sci(result, 1);
+ mpd_snprint_flags(status_str, MPD_MAX_FLAG_STRING, ctx.status);
+ printf("%s %s\n", rstring, status_str);
+
+ mpd_del(a);
+ mpd_del(result);
+ mpd_free(rstring);
+
+ return 0;
+}
+
+
diff --git a/Modules/_decimal/libmpdec/io.c b/Modules/_decimal/libmpdec/io.c
index 9513a68e3782d..e7bd6aee17005 100644
--- a/Modules/_decimal/libmpdec/io.c
+++ b/Modules/_decimal/libmpdec/io.c
@@ -37,17 +37,17 @@
#include <stdlib.h>
#include <string.h>
-#include "typearith.h"
#include "io.h"
+#include "typearith.h"
/* This file contains functions for decimal <-> string conversions, including
PEP-3101 formatting for numeric types. */
-/* Disable warning that is part of -Wextra since gcc 7.0. */
#if defined(__GNUC__) && !defined(__INTEL_COMPILER) && __GNUC__ >= 7
#pragma GCC diagnostic ignored "-Wimplicit-fallthrough"
+ #pragma GCC diagnostic ignored "-Wmisleading-indentation"
#endif
@@ -155,13 +155,13 @@ scan_dpoint_exp(const char *s, const char **dpoint, const char **exp,
s++;
break;
default:
- if (!isdigit((uchar)*s))
+ if (!isdigit((unsigned char)*s))
return NULL;
if (coeff == NULL && *exp == NULL) {
if (*s == '0') {
- if (!isdigit((uchar)*(s+1)))
+ if (!isdigit((unsigned char)*(s+1)))
if (!(*(s+1) == '.' &&
- isdigit((uchar)*(s+2))))
+ isdigit((unsigned char)*(s+2))))
coeff = s;
}
else {
@@ -187,7 +187,7 @@ scan_payload(const char *s, const char **end)
s++;
coeff = s;
- while (isdigit((uchar)*s))
+ while (isdigit((unsigned char)*s))
s++;
*end = s;
@@ -689,8 +689,8 @@ mpd_to_eng_size(char **res, const mpd_t *dec, int fmt)
static int
_mpd_copy_utf8(char dest[5], const char *s)
{
- const uchar *cp = (const uchar *)s;
- uchar lb, ub;
+ const unsigned char *cp = (const unsigned char *)s;
+ unsigned char lb, ub;
int count, i;
@@ -843,7 +843,7 @@ mpd_parse_fmt_str(mpd_spec_t *spec, const char *fmt, int caps)
}
/* minimum width */
- if (isdigit((uchar)*cp)) {
+ if (isdigit((unsigned char)*cp)) {
if (*cp == '0') {
return 0;
}
@@ -865,7 +865,7 @@ mpd_parse_fmt_str(mpd_spec_t *spec, const char *fmt, int caps)
/* fraction digits or significant digits */
if (*cp == '.') {
cp++;
- if (!isdigit((uchar)*cp)) {
+ if (!isdigit((unsigned char)*cp)) {
return 0;
}
errno = 0;
@@ -1105,9 +1105,9 @@ _mpd_apply_lconv(mpd_mbstr_t *result, const mpd_spec_t *spec, uint32_t *status)
sign = dp++;
}
/* integer part */
- assert(isdigit((uchar)*dp));
+ assert(isdigit((unsigned char)*dp));
intpart = dp++;
- while (isdigit((uchar)*dp)) {
+ while (isdigit((unsigned char)*dp)) {
dp++;
}
n_int = (mpd_ssize_t)(dp-intpart);
@@ -1262,8 +1262,8 @@ mpd_qformat_spec(const mpd_t *dec, const mpd_spec_t *spec,
return NULL;
}
- if (isupper((uchar)type)) {
- type = (char)tolower((uchar)type);
+ if (isupper((unsigned char)type)) {
+ type = (char)tolower((unsigned char)type);
flags |= MPD_FMT_UPPER;
}
if (spec->sign == ' ') {
diff --git a/Modules/_decimal/libmpdec/mpalloc.c b/Modules/_decimal/libmpdec/mpalloc.c
index eb5ee7a807b33..5871d5c0f5351 100644
--- a/Modules/_decimal/libmpdec/mpalloc.c
+++ b/Modules/_decimal/libmpdec/mpalloc.c
@@ -61,13 +61,6 @@ mpd_callocfunc_em(size_t nmemb, size_t size)
size_t req;
mpd_size_t overflow;
-#if MPD_SIZE_MAX < SIZE_MAX
- /* full_coverage test only */
- if (nmemb > MPD_SIZE_MAX || size > MPD_SIZE_MAX) {
- return NULL;
- }
-#endif
-
req = mul_size_t_overflow((mpd_size_t)nmemb, (mpd_size_t)size,
&overflow);
if (overflow) {
diff --git a/Modules/_decimal/libmpdec/mpalloc.h b/Modules/_decimal/libmpdec/mpalloc.h
index 186808457b25c..2265004421824 100644
--- a/Modules/_decimal/libmpdec/mpalloc.h
+++ b/Modules/_decimal/libmpdec/mpalloc.h
@@ -39,12 +39,12 @@
MPD_PRAGMA(MPD_HIDE_SYMBOLS_START)
-int mpd_switch_to_dyn(mpd_t *result, mpd_ssize_t size, uint32_t *status);
-int mpd_switch_to_dyn_zero(mpd_t *result, mpd_ssize_t size, uint32_t *status);
-int mpd_realloc_dyn(mpd_t *result, mpd_ssize_t size, uint32_t *status);
+int mpd_switch_to_dyn(mpd_t *result, mpd_ssize_t nwords, uint32_t *status);
+int mpd_switch_to_dyn_zero(mpd_t *result, mpd_ssize_t nwords, uint32_t *status);
+int mpd_realloc_dyn(mpd_t *result, mpd_ssize_t nwords, uint32_t *status);
-int mpd_switch_to_dyn_cxx(mpd_t *result, mpd_ssize_t size);
-int mpd_realloc_dyn_cxx(mpd_t *result, mpd_ssize_t size);
+int mpd_switch_to_dyn_cxx(mpd_t *result, mpd_ssize_t nwords);
+int mpd_realloc_dyn_cxx(mpd_t *result, mpd_ssize_t nwords);
MPD_PRAGMA(MPD_HIDE_SYMBOLS_END) /* restore previous scope rules */
diff --git a/Modules/_decimal/libmpdec/mpdecimal.c b/Modules/_decimal/libmpdec/mpdecimal.c
index f0e4d7f343a43..f1626df46ed46 100644
--- a/Modules/_decimal/libmpdec/mpdecimal.c
+++ b/Modules/_decimal/libmpdec/mpdecimal.c
@@ -64,7 +64,7 @@
#if defined(_MSC_VER)
#define ALWAYS_INLINE __forceinline
-#elif defined(__IBMC__) || defined(LEGACY_COMPILER)
+#elif defined (__IBMC__) || defined(LEGACY_COMPILER)
#define ALWAYS_INLINE
#undef inline
#define inline
@@ -4843,7 +4843,7 @@ _mpd_qln(mpd_t *result, const mpd_t *a, const mpd_context_t *ctx,
uint32_t *status)
{
mpd_context_t varcontext, maxcontext;
- mpd_t *z = (mpd_t *) result;
+ mpd_t *z = result;
MPD_NEW_STATIC(v,0,0,0,0);
MPD_NEW_STATIC(vtmp,0,0,0,0);
MPD_NEW_STATIC(tmp,0,0,0,0);
@@ -6368,7 +6368,7 @@ _mpd_qpow_int(mpd_t *result, const mpd_t *base, const mpd_t *exp,
mpd_context_t workctx;
MPD_NEW_STATIC(tbase,0,0,0,0);
MPD_NEW_STATIC(texp,0,0,0,0);
- mpd_ssize_t n;
+ mpd_uint_t n;
mpd_workcontext(&workctx, ctx);
@@ -8090,7 +8090,6 @@ mpd_sizeinbase(const mpd_t *a, uint32_t base)
}
digits = a->digits+a->exp;
- assert(digits > 0);
#ifdef CONFIG_64
/* ceil(2711437152599294 / log10(2)) + 4 == 2**53 */
diff --git a/Modules/_decimal/libmpdec/mpdecimal.h b/Modules/_decimal/libmpdec/mpdecimal.h
index 9c9f1ca443402..24c280b00ebcd 100644
--- a/Modules/_decimal/libmpdec/mpdecimal.h
+++ b/Modules/_decimal/libmpdec/mpdecimal.h
@@ -40,6 +40,7 @@
#include <cstdint>
#include <cstdio>
#include <cstdlib>
+ #define MPD_UINT8_C(x) (static_cast<uint8_t>(x))
extern "C" {
#else
#include <inttypes.h>
@@ -47,6 +48,7 @@ extern "C" {
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
+ #define MPD_UINT8_C(x) ((uint8_t)x)
#endif
@@ -62,7 +64,6 @@ extern "C" {
#endif
#if defined(_MSC_VER)
- #include "vccompat.h"
#define EXTINLINE extern inline
#else
#define EXTINLINE
@@ -74,25 +75,15 @@ extern "C" {
MPD_PRAGMA(MPD_HIDE_SYMBOLS_START)
-#if !defined(LEGACY_COMPILER)
- #if !defined(UINT64_MAX)
- /* The following #error is just a warning. If the compiler indeed does
- * not have uint64_t, it is perfectly safe to comment out the #error. */
- #error "Warning: Compiler without uint64_t. Comment out this line."
- #define LEGACY_COMPILER
- #endif
-#endif
-
-
/******************************************************************************/
/* Version */
/******************************************************************************/
#define MPD_MAJOR_VERSION 2
#define MPD_MINOR_VERSION 5
-#define MPD_MICRO_VERSION 0
+#define MPD_MICRO_VERSION 1
-#define MPD_VERSION "2.5.0"
+#define MPD_VERSION "2.5.1"
#define MPD_VERSION_HEX ((MPD_MAJOR_VERSION << 24) | \
(MPD_MINOR_VERSION << 16) | \
@@ -162,6 +153,7 @@ typedef int64_t mpd_ssize_t;
#define MPD_EXP_INF 2000000000000000001LL
#define MPD_EXP_CLAMP (-4000000000000000001LL)
#define MPD_MAXIMPORT 105263157894736842L /* ceil((2*MPD_MAX_PREC)/MPD_RDIGITS) */
+#define MPD_IEEE_CONTEXT_MAX_BITS 512 /* 16*(log2(MPD_MAX_EMAX / 3)-3) */
/* conversion specifiers */
#define PRI_mpd_uint_t PRIu64
@@ -203,9 +195,10 @@ typedef int32_t mpd_ssize_t;
#define MPD_MAX_EMAX 425000000L /* ELIMIT-1 */
#define MPD_MIN_EMIN (-425000000L) /* -EMAX */
#define MPD_MIN_ETINY (MPD_MIN_EMIN-(MPD_MAX_PREC-1))
-#define MPD_EXP_INF 1000000001L /* allows for emax=999999999 in the tests */
-#define MPD_EXP_CLAMP (-2000000001L) /* allows for emin=-999999999 in the tests */
-#define MPD_MAXIMPORT 94444445L /* ceil((2*MPD_MAX_PREC)/MPD_RDIGITS) */
+#define MPD_EXP_INF 1000000001L /* allows for emax=999999999 in the tests */
+#define MPD_EXP_CLAMP (-2000000001L) /* allows for emin=-999999999 in the tests */
+#define MPD_MAXIMPORT 94444445L /* ceil((2*MPD_MAX_PREC)/MPD_RDIGITS) */
+#define MPD_IEEE_CONTEXT_MAX_BITS 256 /* 16*(log2(MPD_MAX_EMAX / 3)-3) */
/* conversion specifiers */
#define PRI_mpd_uint_t PRIu32
@@ -242,8 +235,8 @@ enum {
enum { MPD_CLAMP_DEFAULT, MPD_CLAMP_IEEE_754, MPD_CLAMP_GUARD };
-extern const char *mpd_round_string[MPD_ROUND_GUARD];
-extern const char *mpd_clamp_string[MPD_CLAMP_GUARD];
+extern const char * const mpd_round_string[MPD_ROUND_GUARD];
+extern const char * const mpd_clamp_string[MPD_CLAMP_GUARD];
typedef struct mpd_context_t {
@@ -300,7 +293,6 @@ typedef struct mpd_context_t {
#define MPD_Insufficient_storage MPD_Malloc_error
/* IEEE 754 interchange format contexts */
-#define MPD_IEEE_CONTEXT_MAX_BITS 512 /* 16*(log2(MPD_MAX_EMAX / 3)-3) */
#define MPD_DECIMAL32 32
#define MPD_DECIMAL64 64
#define MPD_DECIMAL128 128
@@ -345,16 +337,16 @@ void mpd_addstatus_raise(mpd_context_t *ctx, uint32_t flags);
/******************************************************************************/
/* mpd_t flags */
-#define MPD_POS ((uint8_t)0)
-#define MPD_NEG ((uint8_t)1)
-#define MPD_INF ((uint8_t)2)
-#define MPD_NAN ((uint8_t)4)
-#define MPD_SNAN ((uint8_t)8)
+#define MPD_POS MPD_UINT8_C(0)
+#define MPD_NEG MPD_UINT8_C(1)
+#define MPD_INF MPD_UINT8_C(2)
+#define MPD_NAN MPD_UINT8_C(4)
+#define MPD_SNAN MPD_UINT8_C(8)
#define MPD_SPECIAL (MPD_INF|MPD_NAN|MPD_SNAN)
-#define MPD_STATIC ((uint8_t)16)
-#define MPD_STATIC_DATA ((uint8_t)32)
-#define MPD_SHARED_DATA ((uint8_t)64)
-#define MPD_CONST_DATA ((uint8_t)128)
+#define MPD_STATIC MPD_UINT8_C(16)
+#define MPD_STATIC_DATA MPD_UINT8_C(32)
+#define MPD_SHARED_DATA MPD_UINT8_C(64)
+#define MPD_CONST_DATA MPD_UINT8_C(128)
#define MPD_DATAFLAGS (MPD_STATIC_DATA|MPD_SHARED_DATA|MPD_CONST_DATA)
/* mpd_t */
@@ -368,9 +360,6 @@ typedef struct mpd_t {
} mpd_t;
-typedef unsigned char uchar;
-
-
/******************************************************************************/
/* Triple */
/******************************************************************************/
@@ -442,7 +431,7 @@ void mpd_qset_string_exact(mpd_t *dec, const char *s, uint32_t *status);
/* set to NaN with error flags */
void mpd_seterror(mpd_t *result, uint32_t flags, uint32_t *status);
/* set a special with sign and type */
-void mpd_setspecial(mpd_t *dec, uint8_t sign, uint8_t type);
+void mpd_setspecial(mpd_t *result, uint8_t sign, uint8_t type);
/* set coefficient to zero or all nines */
void mpd_zerocoeff(mpd_t *result);
void mpd_qmaxcoeff(mpd_t *result, const mpd_context_t *ctx, uint32_t *status);
@@ -835,16 +824,16 @@ void *mpd_sh_alloc(mpd_size_t struct_size, mpd_size_t nmemb, mpd_size_t size);
mpd_t *mpd_qnew(void);
mpd_t *mpd_new(mpd_context_t *ctx);
-mpd_t *mpd_qnew_size(mpd_ssize_t size);
+mpd_t *mpd_qnew_size(mpd_ssize_t nwords);
EXTINLINE void mpd_del(mpd_t *dec);
EXTINLINE void mpd_uint_zero(mpd_uint_t *dest, mpd_size_t len);
-EXTINLINE int mpd_qresize(mpd_t *result, mpd_ssize_t size, uint32_t *status);
-EXTINLINE int mpd_qresize_zero(mpd_t *result, mpd_ssize_t size, uint32_t *status);
+EXTINLINE int mpd_qresize(mpd_t *result, mpd_ssize_t nwords, uint32_t *status);
+EXTINLINE int mpd_qresize_zero(mpd_t *result, mpd_ssize_t nwords, uint32_t *status);
EXTINLINE void mpd_minalloc(mpd_t *result);
-int mpd_resize(mpd_t *result, mpd_ssize_t size, mpd_context_t *ctx);
-int mpd_resize_zero(mpd_t *result, mpd_ssize_t size, mpd_context_t *ctx);
+int mpd_resize(mpd_t *result, mpd_ssize_t nwords, mpd_context_t *ctx);
+int mpd_resize_zero(mpd_t *result, mpd_ssize_t nwords, mpd_context_t *ctx);
MPD_PRAGMA(MPD_HIDE_SYMBOLS_END) /* restore previous scope rules */
diff --git a/Modules/_decimal/libmpdec/mpsignal.c b/Modules/_decimal/libmpdec/mpsignal.c
new file mode 100644
index 0000000000000..fc2af48f4f379
--- /dev/null
+++ b/Modules/_decimal/libmpdec/mpsignal.c
@@ -0,0 +1,967 @@
+/*
+ * Copyright (c) 2008-2020 Stefan Krah. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+
+#include "mpdecimal.h"
+
+#include <stddef.h>
+#include <stdint.h>
+
+
+/* Signaling wrappers for the quiet functions in mpdecimal.c. */
+
+
+char *
+mpd_format(const mpd_t *dec, const char *fmt, mpd_context_t *ctx)
+{
+ char *ret;
+ uint32_t status = 0;
+ ret = mpd_qformat(dec, fmt, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+ return ret;
+}
+
+void
+mpd_import_u16(mpd_t *result, const uint16_t *srcdata, size_t srclen,
+ uint8_t srcsign, uint32_t base, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qimport_u16(result, srcdata, srclen, srcsign, base, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_import_u32(mpd_t *result, const uint32_t *srcdata, size_t srclen,
+ uint8_t srcsign, uint32_t base, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qimport_u32(result, srcdata, srclen, srcsign, base, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+size_t
+mpd_export_u16(uint16_t **rdata, size_t rlen, uint32_t base, const mpd_t *src,
+ mpd_context_t *ctx)
+{
+ size_t n;
+ uint32_t status = 0;
+ n = mpd_qexport_u16(rdata, rlen, base, src, &status);
+ mpd_addstatus_raise(ctx, status);
+ return n;
+}
+
+size_t
+mpd_export_u32(uint32_t **rdata, size_t rlen, uint32_t base, const mpd_t *src,
+ mpd_context_t *ctx)
+{
+ size_t n;
+ uint32_t status = 0;
+ n = mpd_qexport_u32(rdata, rlen, base, src, &status);
+ mpd_addstatus_raise(ctx, status);
+ return n;
+}
+
+void
+mpd_finalize(mpd_t *result, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qfinalize(result, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+int
+mpd_check_nan(mpd_t *result, const mpd_t *a, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ if (mpd_qcheck_nan(result, a, ctx, &status)) {
+ mpd_addstatus_raise(ctx, status);
+ return 1;
+ }
+ return 0;
+}
+
+int
+mpd_check_nans(mpd_t *result, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ if (mpd_qcheck_nans(result, a, b, ctx, &status)) {
+ mpd_addstatus_raise(ctx, status);
+ return 1;
+ }
+ return 0;
+}
+
+void
+mpd_set_string(mpd_t *result, const char *s, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qset_string(result, s, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_maxcoeff(mpd_t *result, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qmaxcoeff(result, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+/* set static mpd from signed integer */
+void
+mpd_sset_ssize(mpd_t *result, mpd_ssize_t a, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qsset_ssize(result, a, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_sset_i32(mpd_t *result, int32_t a, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qsset_i32(result, a, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+#ifdef CONFIG_64
+void
+mpd_sset_i64(mpd_t *result, int64_t a, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qsset_i64(result, a, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+#endif
+
+/* set static mpd from unsigned integer */
+void
+mpd_sset_uint(mpd_t *result, mpd_uint_t a, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qsset_uint(result, a, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_sset_u32(mpd_t *result, uint32_t a, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qsset_u32(result, a, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+#ifdef CONFIG_64
+void
+mpd_sset_u64(mpd_t *result, uint64_t a, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qsset_u64(result, a, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+#endif
+
+/* set mpd from signed integer */
+void
+mpd_set_ssize(mpd_t *result, mpd_ssize_t a, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qset_ssize(result, a, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_set_i32(mpd_t *result, int32_t a, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qset_i32(result, a, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+#ifndef LEGACY_COMPILER
+void
+mpd_set_i64(mpd_t *result, int64_t a, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qset_i64(result, a, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+#endif
+
+/* set mpd from unsigned integer */
+void
+mpd_set_uint(mpd_t *result, mpd_uint_t a, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qset_uint(result, a, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_set_u32(mpd_t *result, uint32_t a, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qset_u32(result, a, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+#ifndef LEGACY_COMPILER
+void
+mpd_set_u64(mpd_t *result, uint64_t a, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qset_u64(result, a, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+#endif
+
+/* convert mpd to signed integer */
+mpd_ssize_t
+mpd_get_ssize(const mpd_t *a, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_ssize_t ret;
+
+ ret = mpd_qget_ssize(a, &status);
+ mpd_addstatus_raise(ctx, status);
+ return ret;
+}
+
+int32_t
+mpd_get_i32(const mpd_t *a, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ int32_t ret;
+
+ ret = mpd_qget_i32(a, &status);
+ mpd_addstatus_raise(ctx, status);
+ return ret;
+}
+
+#ifndef LEGACY_COMPILER
+int64_t
+mpd_get_i64(const mpd_t *a, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ int64_t ret;
+
+ ret = mpd_qget_i64(a, &status);
+ mpd_addstatus_raise(ctx, status);
+ return ret;
+}
+#endif
+
+mpd_uint_t
+mpd_get_uint(const mpd_t *a, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_uint_t ret;
+
+ ret = mpd_qget_uint(a, &status);
+ mpd_addstatus_raise(ctx, status);
+ return ret;
+}
+
+mpd_uint_t
+mpd_abs_uint(const mpd_t *a, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_uint_t ret;
+
+ ret = mpd_qabs_uint(a, &status);
+ mpd_addstatus_raise(ctx, status);
+ return ret;
+}
+
+uint32_t
+mpd_get_u32(const mpd_t *a, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ uint32_t ret;
+
+ ret = mpd_qget_u32(a, &status);
+ mpd_addstatus_raise(ctx, status);
+ return ret;
+}
+
+#ifndef LEGACY_COMPILER
+uint64_t
+mpd_get_u64(const mpd_t *a, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ uint64_t ret;
+
+ ret = mpd_qget_u64(a, &status);
+ mpd_addstatus_raise(ctx, status);
+ return ret;
+}
+#endif
+
+void
+mpd_and(mpd_t *result, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qand(result, a, b, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_copy(mpd_t *result, const mpd_t *a, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ if (!mpd_qcopy(result, a, &status)) {
+ mpd_addstatus_raise(ctx, status);
+ }
+}
+
+void
+mpd_canonical(mpd_t *result, const mpd_t *a, mpd_context_t *ctx)
+{
+ mpd_copy(result, a, ctx);
+}
+
+void
+mpd_copy_abs(mpd_t *result, const mpd_t *a, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ if (!mpd_qcopy_abs(result, a, &status)) {
+ mpd_addstatus_raise(ctx, status);
+ }
+}
+
+void
+mpd_copy_negate(mpd_t *result, const mpd_t *a, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ if (!mpd_qcopy_negate(result, a, &status)) {
+ mpd_addstatus_raise(ctx, status);
+ }
+}
+
+void
+mpd_copy_sign(mpd_t *result, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ if (!mpd_qcopy_sign(result, a, b, &status)) {
+ mpd_addstatus_raise(ctx, status);
+ }
+}
+
+void
+mpd_invert(mpd_t *result, const mpd_t *a, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qinvert(result, a, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_logb(mpd_t *result, const mpd_t *a, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qlogb(result, a, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_or(mpd_t *result, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qor(result, a, b, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_rotate(mpd_t *result, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qrotate(result, a, b, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_scaleb(mpd_t *result, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qscaleb(result, a, b, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_shiftl(mpd_t *result, const mpd_t *a, mpd_ssize_t n, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qshiftl(result, a, n, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+mpd_uint_t
+mpd_shiftr(mpd_t *result, const mpd_t *a, mpd_ssize_t n, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_uint_t rnd;
+
+ rnd = mpd_qshiftr(result, a, n, &status);
+ mpd_addstatus_raise(ctx, status);
+ return rnd;
+}
+
+void
+mpd_shiftn(mpd_t *result, const mpd_t *a, mpd_ssize_t n, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qshiftn(result, a, n, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_shift(mpd_t *result, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qshift(result, a, b, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_xor(mpd_t *result, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qxor(result, a, b, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_abs(mpd_t *result, const mpd_t *a, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qabs(result, a, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+int
+mpd_cmp(const mpd_t *a, const mpd_t *b, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ int c;
+ c = mpd_qcmp(a, b, &status);
+ mpd_addstatus_raise(ctx, status);
+ return c;
+}
+
+int
+mpd_compare(mpd_t *result, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ int c;
+ c = mpd_qcompare(result, a, b, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+ return c;
+}
+
+int
+mpd_compare_signal(mpd_t *result, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ int c;
+ c = mpd_qcompare_signal(result, a, b, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+ return c;
+}
+
+void
+mpd_add(mpd_t *result, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qadd(result, a, b, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_sub(mpd_t *result, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qsub(result, a, b, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_add_ssize(mpd_t *result, const mpd_t *a, mpd_ssize_t b, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qadd_ssize(result, a, b, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_add_i32(mpd_t *result, const mpd_t *a, int32_t b, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qadd_i32(result, a, b, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+#ifndef LEGACY_COMPILER
+void
+mpd_add_i64(mpd_t *result, const mpd_t *a, int64_t b, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qadd_i64(result, a, b, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+#endif
+
+void
+mpd_add_uint(mpd_t *result, const mpd_t *a, mpd_uint_t b, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qadd_uint(result, a, b, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_add_u32(mpd_t *result, const mpd_t *a, uint32_t b, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qadd_u32(result, a, b, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+#ifndef LEGACY_COMPILER
+void
+mpd_add_u64(mpd_t *result, const mpd_t *a, uint64_t b, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qadd_u64(result, a, b, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+#endif
+
+void
+mpd_sub_ssize(mpd_t *result, const mpd_t *a, mpd_ssize_t b, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qsub_ssize(result, a, b, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_sub_i32(mpd_t *result, const mpd_t *a, int32_t b, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qsub_i32(result, a, b, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+#ifndef LEGACY_COMPILER
+void
+mpd_sub_i64(mpd_t *result, const mpd_t *a, int64_t b, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qsub_i64(result, a, b, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+#endif
+
+void
+mpd_sub_uint(mpd_t *result, const mpd_t *a, mpd_uint_t b, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qsub_uint(result, a, b, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_sub_u32(mpd_t *result, const mpd_t *a, uint32_t b, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qsub_u32(result, a, b, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+#ifndef LEGACY_COMPILER
+void
+mpd_sub_u64(mpd_t *result, const mpd_t *a, uint64_t b, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qsub_u64(result, a, b, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+#endif
+
+void
+mpd_div(mpd_t *q, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qdiv(q, a, b, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_div_ssize(mpd_t *result, const mpd_t *a, mpd_ssize_t b, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qdiv_ssize(result, a, b, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_div_i32(mpd_t *result, const mpd_t *a, int32_t b, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qdiv_i32(result, a, b, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+#ifndef LEGACY_COMPILER
+void
+mpd_div_i64(mpd_t *result, const mpd_t *a, int64_t b, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qdiv_i64(result, a, b, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+#endif
+
+void
+mpd_div_uint(mpd_t *result, const mpd_t *a, mpd_uint_t b, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qdiv_uint(result, a, b, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_div_u32(mpd_t *result, const mpd_t *a, uint32_t b, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qdiv_u32(result, a, b, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+#ifndef LEGACY_COMPILER
+void
+mpd_div_u64(mpd_t *result, const mpd_t *a, uint64_t b, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qdiv_u64(result, a, b, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+#endif
+
+void
+mpd_divmod(mpd_t *q, mpd_t *r, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qdivmod(q, r, a, b, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_divint(mpd_t *q, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qdivint(q, a, b, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_exp(mpd_t *result, const mpd_t *a, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qexp(result, a, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_fma(mpd_t *result, const mpd_t *a, const mpd_t *b, const mpd_t *c,
+ mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qfma(result, a, b, c, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_ln(mpd_t *result, const mpd_t *a, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qln(result, a, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_log10(mpd_t *result, const mpd_t *a, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qlog10(result, a, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_max(mpd_t *result, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qmax(result, a, b, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_max_mag(mpd_t *result, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qmax_mag(result, a, b, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_min(mpd_t *result, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qmin(result, a, b, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_min_mag(mpd_t *result, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qmin_mag(result, a, b, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_minus(mpd_t *result, const mpd_t *a, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qminus(result, a, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_mul(mpd_t *result, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qmul(result, a, b, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_mul_ssize(mpd_t *result, const mpd_t *a, mpd_ssize_t b, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qmul_ssize(result, a, b, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_mul_i32(mpd_t *result, const mpd_t *a, int32_t b, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qmul_i32(result, a, b, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+#ifndef LEGACY_COMPILER
+void
+mpd_mul_i64(mpd_t *result, const mpd_t *a, int64_t b, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qmul_i64(result, a, b, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+#endif
+
+void
+mpd_mul_uint(mpd_t *result, const mpd_t *a, mpd_uint_t b, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qmul_uint(result, a, b, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_mul_u32(mpd_t *result, const mpd_t *a, uint32_t b, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qmul_u32(result, a, b, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+#ifndef LEGACY_COMPILER
+void
+mpd_mul_u64(mpd_t *result, const mpd_t *a, uint64_t b, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qmul_u64(result, a, b, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+#endif
+
+void
+mpd_next_minus(mpd_t *result, const mpd_t *a, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qnext_minus(result, a, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_next_plus(mpd_t *result, const mpd_t *a, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qnext_plus(result, a, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_next_toward(mpd_t *result, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qnext_toward(result, a, b, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_plus(mpd_t *result, const mpd_t *a, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qplus(result, a, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_pow(mpd_t *result, const mpd_t *base, const mpd_t *exp, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qpow(result, base, exp, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_powmod(mpd_t *result, const mpd_t *base, const mpd_t *exp, const mpd_t *mod,
+ mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qpowmod(result, base, exp, mod, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_quantize(mpd_t *result, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qquantize(result, a, b, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_rescale(mpd_t *result, const mpd_t *a, mpd_ssize_t exp, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qrescale(result, a, exp, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_reduce(mpd_t *result, const mpd_t *a, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qreduce(result, a, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_rem(mpd_t *r, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qrem(r, a, b, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_rem_near(mpd_t *r, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qrem_near(r, a, b, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_round_to_intx(mpd_t *result, const mpd_t *a, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qround_to_intx(result, a, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_round_to_int(mpd_t *result, const mpd_t *a, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qround_to_int(result, a, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_trunc(mpd_t *result, const mpd_t *a, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qtrunc(result, a, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_floor(mpd_t *result, const mpd_t *a, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qfloor(result, a, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_ceil(mpd_t *result, const mpd_t *a, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qceil(result, a, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_sqrt(mpd_t *result, const mpd_t *a, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qsqrt(result, a, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_invroot(mpd_t *result, const mpd_t *a, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qinvroot(result, a, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
diff --git a/Modules/_decimal/libmpdec/typearith.h b/Modules/_decimal/libmpdec/typearith.h
index 47961788d7641..dd3776453d098 100644
--- a/Modules/_decimal/libmpdec/typearith.h
+++ b/Modules/_decimal/libmpdec/typearith.h
@@ -638,10 +638,10 @@ add_size_t_overflow(mpd_size_t a, mpd_size_t b, mpd_size_t *overflow)
static inline mpd_size_t
mul_size_t_overflow(mpd_size_t a, mpd_size_t b, mpd_size_t *overflow)
{
- mpd_uint_t lo;
+ mpd_uint_t hi, lo;
- _mpd_mul_words((mpd_uint_t *)overflow, &lo, (mpd_uint_t)a,
- (mpd_uint_t)b);
+ _mpd_mul_words(&hi, &lo, (mpd_uint_t)a, (mpd_uint_t)b);
+ *overflow = (mpd_size_t)hi;
return lo;
}
diff --git a/setup.py b/setup.py
index a7d00841d0559..e3fbd78bc08b8 100644
--- a/setup.py
+++ b/setup.py
@@ -2290,7 +2290,7 @@ def detect_decimal(self):
undef_macros = []
if '--with-system-libmpdec' in sysconfig.get_config_var("CONFIG_ARGS"):
include_dirs = []
- libraries = [':libmpdec.so.2']
+ libraries = ['mpdec']
sources = ['_decimal/_decimal.c']
depends = ['_decimal/docstrings.h']
else:
[View Less]
1
0

bpo-42134: Raise ImportWarning when calling find_module() in the import system (GH-25044)
by brettcannon March 30, 2021
by brettcannon March 30, 2021
March 30, 2021
https://github.com/python/cpython/commit/a7ff6df60c05e1b69fca743573b1e118be…
commit: a7ff6df60c05e1b69fca743573b1e118bebf121d
branch: master
author: Brett Cannon <brett(a)python.org>
committer: brettcannon <brett(a)python.org>
date: 2021-03-30T08:43:03-07:00
summary:
bpo-42134: Raise ImportWarning when calling find_module() in the import system (GH-25044)
files:
A Misc/NEWS.d/next/Core and Builtins/2021-03-26-17-30-19.bpo-42134.G4Sjxg.rst
M Doc/reference/import.rst
M Doc/whatsnew/…
[View More]3.10.rst
M Lib/importlib/_bootstrap.py
M Lib/importlib/_bootstrap_external.py
M Lib/test/test_importlib/import_/test_path.py
M Lib/test/test_importlib/test_api.py
M Python/importlib.h
M Python/importlib_external.h
diff --git a/Doc/reference/import.rst b/Doc/reference/import.rst
index b5ac21d481927..5d2169b4cba60 100644
--- a/Doc/reference/import.rst
+++ b/Doc/reference/import.rst
@@ -329,6 +329,10 @@ modules, and one that knows how to import modules from an :term:`import path`
import machinery will try it only if the finder does not implement
``find_spec()``.
+.. versionchanged:: 3.10
+ Use of :meth:`~importlib.abc.MetaPathFinder.find_module` by the import system
+ now raises :exc:`ImportWarning`.
+
Loading
=======
@@ -470,6 +474,9 @@ import machinery will create the new module itself.
An :exc:`ImportError` is raised when ``exec_module()`` is defined but
``create_module()`` is not.
+.. versionchanged:: 3.10
+ Use of ``load_module()`` will raise :exc:`ImportWarning`.
+
Submodules
----------
@@ -896,6 +903,10 @@ a list containing the portion.
exist on a path entry finder, the import system will always call
``find_loader()`` in preference to ``find_module()``.
+.. versionchanged:: 3.10
+ Calls to :meth:`~importlib.abc.PathEntryFinder.find_module` by the import
+ system will raise :exc:`ImportWarning`.
+
Replacing the standard import system
====================================
diff --git a/Doc/whatsnew/3.10.rst b/Doc/whatsnew/3.10.rst
index 3a563c10282c8..e09cfb44276ab 100644
--- a/Doc/whatsnew/3.10.rst
+++ b/Doc/whatsnew/3.10.rst
@@ -1028,6 +1028,15 @@ Deprecated
:meth:`~importlib.abc.Loader.exec_module` is preferred.
(Contributed by Brett Cannon in :issue:`26131`.)
+* The use of :meth:`importlib.abc.MetaPathFinder.find_module` and
+ :meth:`importlib.abc.PathEntryFinder.find_module` by the import system now
+ trigger an :exc:`ImportWarning` as
+ :meth:`importlib.abc.MetaPathFinder.find_spec` and
+ :meth:`importlib.abc.PathEntryFinder.find_spec`
+ are preferred, respectively. You can use
+ :func:`importlib.util.spec_from_loader` to help in porting.
+ (Contributed by Brett Cannon in :issue:`42134`.)
+
* The import system now uses the ``__spec__`` attribute on modules before
falling back on :meth:`~importlib.abc.Loader.module_repr` for a module's
``__repr__()`` method. Removal of the use of ``module_repr()`` is scheduled
diff --git a/Lib/importlib/_bootstrap.py b/Lib/importlib/_bootstrap.py
index d5acb6545f8fa..ab52e778fda87 100644
--- a/Lib/importlib/_bootstrap.py
+++ b/Lib/importlib/_bootstrap.py
@@ -903,8 +903,9 @@ def _resolve_name(name, package, level):
def _find_spec_legacy(finder, name, path):
- # This would be a good place for a DeprecationWarning if
- # we ended up going that route.
+ msg = (f"{_object_name(finder)}.find_spec() not found; "
+ "falling back to find_module()")
+ _warnings.warn(msg, ImportWarning)
loader = finder.find_module(name, path)
if loader is None:
return None
diff --git a/Lib/importlib/_bootstrap_external.py b/Lib/importlib/_bootstrap_external.py
index dac881fa42f3e..bf7c2686037d7 100644
--- a/Lib/importlib/_bootstrap_external.py
+++ b/Lib/importlib/_bootstrap_external.py
@@ -1324,6 +1324,9 @@ def _legacy_get_spec(cls, fullname, finder):
if hasattr(finder, 'find_loader'):
loader, portions = finder.find_loader(fullname)
else:
+ msg = (f"{_bootstrap._object_name(finder)}.find_spec() not found; "
+ "falling back to find_module()")
+ _warnings.warn(msg, ImportWarning)
loader = finder.find_module(fullname)
portions = []
if loader is not None:
diff --git a/Lib/test/test_importlib/import_/test_path.py b/Lib/test/test_importlib/import_/test_path.py
index 18c81dda45c8c..c51aee22bb8dc 100644
--- a/Lib/test/test_importlib/import_/test_path.py
+++ b/Lib/test/test_importlib/import_/test_path.py
@@ -123,12 +123,16 @@ def find_module(self, fullname):
failing_finder.to_return = None
path = 'testing path'
with util.import_state(path_importer_cache={path: failing_finder}):
- self.assertIsNone(
+ with warnings.catch_warnings():
+ warnings.simplefilter("ignore", ImportWarning)
+ self.assertIsNone(
self.machinery.PathFinder.find_spec('whatever', [path]))
success_finder = TestFinder()
success_finder.to_return = __loader__
with util.import_state(path_importer_cache={path: success_finder}):
- spec = self.machinery.PathFinder.find_spec('whatever', [path])
+ with warnings.catch_warnings():
+ warnings.simplefilter("ignore", ImportWarning)
+ spec = self.machinery.PathFinder.find_spec('whatever', [path])
self.assertEqual(spec.loader, __loader__)
def test_finder_with_find_loader(self):
@@ -248,7 +252,9 @@ def find_module(fullname):
with util.import_state(path=[Finder.path_location]+sys.path[:],
path_hooks=[Finder]):
- self.machinery.PathFinder.find_spec('importlib')
+ with warnings.catch_warnings():
+ warnings.simplefilter("ignore", ImportWarning)
+ self.machinery.PathFinder.find_spec('importlib')
def test_finder_with_failing_find_module(self):
# PathEntryFinder with find_module() defined should work.
@@ -266,7 +272,9 @@ def find_module(fullname):
with util.import_state(path=[Finder.path_location]+sys.path[:],
path_hooks=[Finder]):
- self.machinery.PathFinder.find_module('importlib')
+ with warnings.catch_warnings():
+ warnings.simplefilter("ignore", ImportWarning)
+ self.machinery.PathFinder.find_module('importlib')
(Frozen_PEFTests,
diff --git a/Lib/test/test_importlib/test_api.py b/Lib/test/test_importlib/test_api.py
index 3f06a10ba9c5e..384ae9ca7a57a 100644
--- a/Lib/test/test_importlib/test_api.py
+++ b/Lib/test/test_importlib/test_api.py
@@ -151,6 +151,7 @@ def test_success(self):
with test_util.import_state(meta_path=[self.FakeMetaFinder]):
with warnings.catch_warnings():
warnings.simplefilter('ignore', DeprecationWarning)
+ warnings.simplefilter('ignore', ImportWarning)
self.assertEqual((name, None), self.init.find_loader(name))
def test_success_path(self):
@@ -161,6 +162,7 @@ def test_success_path(self):
with test_util.import_state(meta_path=[self.FakeMetaFinder]):
with warnings.catch_warnings():
warnings.simplefilter('ignore', DeprecationWarning)
+ warnings.simplefilter('ignore', ImportWarning)
self.assertEqual((name, path),
self.init.find_loader(name, path))
diff --git a/Misc/NEWS.d/next/Core and Builtins/2021-03-26-17-30-19.bpo-42134.G4Sjxg.rst b/Misc/NEWS.d/next/Core and Builtins/2021-03-26-17-30-19.bpo-42134.G4Sjxg.rst
new file mode 100644
index 0000000000000..72d13e37c937b
--- /dev/null
+++ b/Misc/NEWS.d/next/Core and Builtins/2021-03-26-17-30-19.bpo-42134.G4Sjxg.rst
@@ -0,0 +1 @@
+Calls to find_module() by the import system now raise ImportWarning.
diff --git a/Python/importlib.h b/Python/importlib.h
index f14126257e546..886b807aba0c0 100644
--- a/Python/importlib.h
+++ b/Python/importlib.h
@@ -1420,448 +1420,455 @@ const unsigned char _Py_M__importlib_bootstrap[] = {
95,114,101,115,111,108,118,101,95,110,97,109,101,128,3,0,
0,115,12,0,0,0,16,2,12,1,8,1,8,1,20,1,
255,128,114,210,0,0,0,99,3,0,0,0,0,0,0,0,
- 0,0,0,0,4,0,0,0,4,0,0,0,67,0,0,0,
- 115,34,0,0,0,124,0,160,0,124,1,124,2,161,2,125,
- 3,124,3,100,0,117,0,114,24,100,0,83,0,116,1,124,
- 1,124,3,131,2,83,0,114,0,0,0,0,41,2,114,184,
- 0,0,0,114,104,0,0,0,41,4,218,6,102,105,110,100,
- 101,114,114,20,0,0,0,114,181,0,0,0,114,122,0,0,
- 0,114,5,0,0,0,114,5,0,0,0,114,6,0,0,0,
- 218,17,95,102,105,110,100,95,115,112,101,99,95,108,101,103,
- 97,99,121,137,3,0,0,115,10,0,0,0,12,3,8,1,
- 4,1,10,1,255,128,114,212,0,0,0,99,3,0,0,0,
- 0,0,0,0,0,0,0,0,10,0,0,0,10,0,0,0,
- 67,0,0,0,115,36,1,0,0,116,0,106,1,125,3,124,
- 3,100,1,117,0,114,22,116,2,100,2,131,1,130,1,124,
- 3,115,38,116,3,160,4,100,3,116,5,161,2,1,0,124,
- 0,116,0,106,6,118,0,125,4,124,3,68,0,93,230,125,
- 5,116,7,131,0,143,94,1,0,122,10,124,5,106,8,125,
- 6,87,0,110,54,4,0,116,9,144,1,121,34,1,0,1,
- 0,1,0,116,10,124,5,124,0,124,1,131,3,125,7,124,
- 7,100,1,117,0,114,126,89,0,87,0,100,1,4,0,4,
- 0,131,3,1,0,113,52,89,0,110,12,124,6,124,0,124,
- 1,124,2,131,3,125,7,87,0,100,1,4,0,4,0,131,
- 3,1,0,110,16,49,0,115,162,119,1,1,0,1,0,1,
- 0,89,0,1,0,124,7,100,1,117,1,144,1,114,26,124,
- 4,144,1,115,18,124,0,116,0,106,6,118,0,144,1,114,
- 18,116,0,106,6,124,0,25,0,125,8,122,10,124,8,106,
- 11,125,9,87,0,110,26,4,0,116,9,144,1,121,32,1,
- 0,1,0,1,0,124,7,6,0,89,0,2,0,1,0,83,
- 0,124,9,100,1,117,0,144,1,114,10,124,7,2,0,1,
- 0,83,0,124,9,2,0,1,0,83,0,124,7,2,0,1,
- 0,83,0,113,52,100,1,83,0,119,0,119,0,41,4,122,
- 21,70,105,110,100,32,97,32,109,111,100,117,108,101,39,115,
- 32,115,112,101,99,46,78,122,53,115,121,115,46,109,101,116,
- 97,95,112,97,116,104,32,105,115,32,78,111,110,101,44,32,
- 80,121,116,104,111,110,32,105,115,32,108,105,107,101,108,121,
- 32,115,104,117,116,116,105,110,103,32,100,111,119,110,122,22,
- 115,121,115,46,109,101,116,97,95,112,97,116,104,32,105,115,
- 32,101,109,112,116,121,41,12,114,18,0,0,0,218,9,109,
- 101,116,97,95,112,97,116,104,114,87,0,0,0,114,101,0,
- 0,0,114,102,0,0,0,114,169,0,0,0,114,105,0,0,
- 0,114,199,0,0,0,114,183,0,0,0,114,2,0,0,0,
- 114,212,0,0,0,114,113,0,0,0,41,10,114,20,0,0,
- 0,114,181,0,0,0,114,182,0,0,0,114,213,0,0,0,
- 90,9,105,115,95,114,101,108,111,97,100,114,211,0,0,0,
- 114,183,0,0,0,114,109,0,0,0,114,110,0,0,0,114,
- 113,0,0,0,114,5,0,0,0,114,5,0,0,0,114,6,
- 0,0,0,218,10,95,102,105,110,100,95,115,112,101,99,146,
- 3,0,0,115,66,0,0,0,6,2,8,1,8,2,4,3,
- 12,1,10,5,8,1,8,1,2,1,10,1,14,1,12,1,
- 8,1,16,1,4,255,12,3,30,128,10,1,18,2,10,1,
- 2,1,10,1,14,1,12,4,10,2,8,1,8,2,8,2,
- 2,239,4,19,2,243,2,244,255,128,114,214,0,0,0,99,
- 3,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,
- 5,0,0,0,67,0,0,0,115,110,0,0,0,116,0,124,
- 0,116,1,131,2,115,28,116,2,100,1,160,3,116,4,124,
- 0,131,1,161,1,131,1,130,1,124,2,100,2,107,0,114,
- 44,116,5,100,3,131,1,130,1,124,2,100,2,107,4,114,
- 82,116,0,124,1,116,1,131,2,115,70,116,2,100,4,131,
- 1,130,1,124,1,115,82,116,6,100,5,131,1,130,1,124,
- 0,115,106,124,2,100,2,107,2,114,102,116,5,100,6,131,
- 1,130,1,100,7,83,0,100,7,83,0,41,8,122,28,86,
- 101,114,105,102,121,32,97,114,103,117,109,101,110,116,115,32,
- 97,114,101,32,34,115,97,110,101,34,46,122,31,109,111,100,
- 117,108,101,32,110,97,109,101,32,109,117,115,116,32,98,101,
- 32,115,116,114,44,32,110,111,116,32,123,125,114,25,0,0,
- 0,122,18,108,101,118,101,108,32,109,117,115,116,32,98,101,
- 32,62,61,32,48,122,31,95,95,112,97,99,107,97,103,101,
- 95,95,32,110,111,116,32,115,101,116,32,116,111,32,97,32,
- 115,116,114,105,110,103,122,54,97,116,116,101,109,112,116,101,
- 100,32,114,101,108,97,116,105,118,101,32,105,109,112,111,114,
- 116,32,119,105,116,104,32,110,111,32,107,110,111,119,110,32,
- 112,97,114,101,110,116,32,112,97,99,107,97,103,101,122,17,
- 69,109,112,116,121,32,109,111,100,117,108,101,32,110,97,109,
- 101,78,41,7,218,10,105,115,105,110,115,116,97,110,99,101,
- 218,3,115,116,114,218,9,84,121,112,101,69,114,114,111,114,
- 114,50,0,0,0,114,3,0,0,0,218,10,86,97,108,117,
- 101,69,114,114,111,114,114,87,0,0,0,169,3,114,20,0,
- 0,0,114,208,0,0,0,114,209,0,0,0,114,5,0,0,
- 0,114,5,0,0,0,114,6,0,0,0,218,13,95,115,97,
- 110,105,116,121,95,99,104,101,99,107,193,3,0,0,115,26,
- 0,0,0,10,2,18,1,8,1,8,1,8,1,10,1,8,
- 1,4,1,8,1,12,2,8,1,8,255,255,128,114,220,0,
- 0,0,122,16,78,111,32,109,111,100,117,108,101,32,110,97,
- 109,101,100,32,122,4,123,33,114,125,99,2,0,0,0,0,
- 0,0,0,0,0,0,0,9,0,0,0,8,0,0,0,67,
- 0,0,0,115,22,1,0,0,100,0,125,2,124,0,160,0,
- 100,1,161,1,100,2,25,0,125,3,124,3,114,128,124,3,
- 116,1,106,2,118,1,114,42,116,3,124,1,124,3,131,2,
- 1,0,124,0,116,1,106,2,118,0,114,62,116,1,106,2,
- 124,0,25,0,83,0,116,1,106,2,124,3,25,0,125,4,
- 122,10,124,4,106,4,125,2,87,0,110,44,4,0,116,5,
- 144,1,121,20,1,0,1,0,1,0,116,6,100,3,23,0,
- 160,7,124,0,124,3,161,2,125,5,116,8,124,5,124,0,
- 100,4,141,2,100,0,130,2,116,9,124,0,124,2,131,2,
- 125,6,124,6,100,0,117,0,114,164,116,8,116,6,160,7,
- 124,0,161,1,124,0,100,4,141,2,130,1,116,10,124,6,
- 131,1,125,7,124,3,144,1,114,14,116,1,106,2,124,3,
- 25,0,125,4,124,0,160,0,100,1,161,1,100,5,25,0,
- 125,8,122,18,116,11,124,4,124,8,124,7,131,3,1,0,
- 87,0,124,7,83,0,4,0,116,5,144,1,121,18,1,0,
- 1,0,1,0,100,6,124,3,155,2,100,7,124,8,155,2,
- 157,4,125,5,116,12,160,13,124,5,116,14,161,2,1,0,
- 89,0,124,7,83,0,124,7,83,0,119,0,119,0,41,8,
- 78,114,141,0,0,0,114,25,0,0,0,122,23,59,32,123,
- 33,114,125,32,105,115,32,110,111,116,32,97,32,112,97,99,
- 107,97,103,101,114,19,0,0,0,233,2,0,0,0,122,27,
- 67,97,110,110,111,116,32,115,101,116,32,97,110,32,97,116,
- 116,114,105,98,117,116,101,32,111,110,32,122,18,32,102,111,
- 114,32,99,104,105,108,100,32,109,111,100,117,108,101,32,41,
- 15,114,142,0,0,0,114,18,0,0,0,114,105,0,0,0,
- 114,74,0,0,0,114,154,0,0,0,114,2,0,0,0,218,
- 8,95,69,82,82,95,77,83,71,114,50,0,0,0,218,19,
- 77,111,100,117,108,101,78,111,116,70,111,117,110,100,69,114,
- 114,111,114,114,214,0,0,0,114,173,0,0,0,114,12,0,
+ 0,0,0,0,5,0,0,0,4,0,0,0,67,0,0,0,
+ 115,60,0,0,0,116,0,124,0,131,1,155,0,100,1,157,
+ 2,125,3,116,1,160,2,124,3,116,3,161,2,1,0,124,
+ 0,160,4,124,1,124,2,161,2,125,4,124,4,100,0,117,
+ 0,114,50,100,0,83,0,116,5,124,1,124,4,131,2,83,
+ 0,41,2,78,122,53,46,102,105,110,100,95,115,112,101,99,
+ 40,41,32,110,111,116,32,102,111,117,110,100,59,32,102,97,
+ 108,108,105,110,103,32,98,97,99,107,32,116,111,32,102,105,
+ 110,100,95,109,111,100,117,108,101,40,41,41,6,114,7,0,
0,0,114,101,0,0,0,114,102,0,0,0,114,169,0,0,
- 0,41,9,114,20,0,0,0,218,7,105,109,112,111,114,116,
- 95,114,181,0,0,0,114,143,0,0,0,90,13,112,97,114,
- 101,110,116,95,109,111,100,117,108,101,114,108,0,0,0,114,
- 109,0,0,0,114,110,0,0,0,90,5,99,104,105,108,100,
+ 0,114,184,0,0,0,114,104,0,0,0,41,5,218,6,102,
+ 105,110,100,101,114,114,20,0,0,0,114,181,0,0,0,114,
+ 108,0,0,0,114,122,0,0,0,114,5,0,0,0,114,5,
+ 0,0,0,114,6,0,0,0,218,17,95,102,105,110,100,95,
+ 115,112,101,99,95,108,101,103,97,99,121,137,3,0,0,115,
+ 14,0,0,0,14,1,12,2,12,1,8,1,4,1,10,1,
+ 255,128,114,212,0,0,0,99,3,0,0,0,0,0,0,0,
+ 0,0,0,0,10,0,0,0,10,0,0,0,67,0,0,0,
+ 115,36,1,0,0,116,0,106,1,125,3,124,3,100,1,117,
+ 0,114,22,116,2,100,2,131,1,130,1,124,3,115,38,116,
+ 3,160,4,100,3,116,5,161,2,1,0,124,0,116,0,106,
+ 6,118,0,125,4,124,3,68,0,93,230,125,5,116,7,131,
+ 0,143,94,1,0,122,10,124,5,106,8,125,6,87,0,110,
+ 54,4,0,116,9,144,1,121,34,1,0,1,0,1,0,116,
+ 10,124,5,124,0,124,1,131,3,125,7,124,7,100,1,117,
+ 0,114,126,89,0,87,0,100,1,4,0,4,0,131,3,1,
+ 0,113,52,89,0,110,12,124,6,124,0,124,1,124,2,131,
+ 3,125,7,87,0,100,1,4,0,4,0,131,3,1,0,110,
+ 16,49,0,115,162,119,1,1,0,1,0,1,0,89,0,1,
+ 0,124,7,100,1,117,1,144,1,114,26,124,4,144,1,115,
+ 18,124,0,116,0,106,6,118,0,144,1,114,18,116,0,106,
+ 6,124,0,25,0,125,8,122,10,124,8,106,11,125,9,87,
+ 0,110,26,4,0,116,9,144,1,121,32,1,0,1,0,1,
+ 0,124,7,6,0,89,0,2,0,1,0,83,0,124,9,100,
+ 1,117,0,144,1,114,10,124,7,2,0,1,0,83,0,124,
+ 9,2,0,1,0,83,0,124,7,2,0,1,0,83,0,113,
+ 52,100,1,83,0,119,0,119,0,41,4,122,21,70,105,110,
+ 100,32,97,32,109,111,100,117,108,101,39,115,32,115,112,101,
+ 99,46,78,122,53,115,121,115,46,109,101,116,97,95,112,97,
+ 116,104,32,105,115,32,78,111,110,101,44,32,80,121,116,104,
+ 111,110,32,105,115,32,108,105,107,101,108,121,32,115,104,117,
+ 116,116,105,110,103,32,100,111,119,110,122,22,115,121,115,46,
+ 109,101,116,97,95,112,97,116,104,32,105,115,32,101,109,112,
+ 116,121,41,12,114,18,0,0,0,218,9,109,101,116,97,95,
+ 112,97,116,104,114,87,0,0,0,114,101,0,0,0,114,102,
+ 0,0,0,114,169,0,0,0,114,105,0,0,0,114,199,0,
+ 0,0,114,183,0,0,0,114,2,0,0,0,114,212,0,0,
+ 0,114,113,0,0,0,41,10,114,20,0,0,0,114,181,0,
+ 0,0,114,182,0,0,0,114,213,0,0,0,90,9,105,115,
+ 95,114,101,108,111,97,100,114,211,0,0,0,114,183,0,0,
+ 0,114,109,0,0,0,114,110,0,0,0,114,113,0,0,0,
114,5,0,0,0,114,5,0,0,0,114,6,0,0,0,218,
- 23,95,102,105,110,100,95,97,110,100,95,108,111,97,100,95,
- 117,110,108,111,99,107,101,100,212,3,0,0,115,60,0,0,
- 0,4,1,14,1,4,1,10,1,10,1,10,2,10,1,10,
- 1,2,1,10,1,14,1,16,1,14,1,10,1,8,1,18,
- 1,8,2,6,1,10,2,14,1,2,1,14,1,4,4,14,
- 253,16,1,14,1,8,1,2,253,2,242,255,128,114,225,0,
- 0,0,99,2,0,0,0,0,0,0,0,0,0,0,0,4,
- 0,0,0,8,0,0,0,67,0,0,0,115,128,0,0,0,
- 116,0,124,0,131,1,143,62,1,0,116,1,106,2,160,3,
- 124,0,116,4,161,2,125,2,124,2,116,4,117,0,114,56,
- 116,5,124,0,124,1,131,2,87,0,2,0,100,1,4,0,
- 4,0,131,3,1,0,83,0,87,0,100,1,4,0,4,0,
- 131,3,1,0,110,16,49,0,115,76,119,1,1,0,1,0,
- 1,0,89,0,1,0,124,2,100,1,117,0,114,116,100,2,
- 160,6,124,0,161,1,125,3,116,7,124,3,124,0,100,3,
- 141,2,130,1,116,8,124,0,131,1,1,0,124,2,83,0,
- 41,4,122,25,70,105,110,100,32,97,110,100,32,108,111,97,
- 100,32,116,104,101,32,109,111,100,117,108,101,46,78,122,40,
- 105,109,112,111,114,116,32,111,102,32,123,125,32,104,97,108,
- 116,101,100,59,32,78,111,110,101,32,105,110,32,115,121,115,
- 46,109,111,100,117,108,101,115,114,19,0,0,0,41,9,114,
- 57,0,0,0,114,18,0,0,0,114,105,0,0,0,114,38,
- 0,0,0,218,14,95,78,69,69,68,83,95,76,79,65,68,
- 73,78,71,114,225,0,0,0,114,50,0,0,0,114,223,0,
- 0,0,114,72,0,0,0,41,4,114,20,0,0,0,114,224,
- 0,0,0,114,110,0,0,0,114,82,0,0,0,114,5,0,
- 0,0,114,5,0,0,0,114,6,0,0,0,218,14,95,102,
- 105,110,100,95,97,110,100,95,108,111,97,100,247,3,0,0,
- 115,28,0,0,0,10,2,14,1,8,1,24,1,14,255,16,
- 128,8,3,2,1,6,1,2,255,12,2,8,2,4,1,255,
- 128,114,227,0,0,0,114,25,0,0,0,99,3,0,0,0,
- 0,0,0,0,0,0,0,0,3,0,0,0,4,0,0,0,
- 67,0,0,0,115,42,0,0,0,116,0,124,0,124,1,124,
- 2,131,3,1,0,124,2,100,1,107,4,114,32,116,1,124,
- 0,124,1,124,2,131,3,125,0,116,2,124,0,116,3,131,
- 2,83,0,41,3,97,50,1,0,0,73,109,112,111,114,116,
- 32,97,110,100,32,114,101,116,117,114,110,32,116,104,101,32,
- 109,111,100,117,108,101,32,98,97,115,101,100,32,111,110,32,
- 105,116,115,32,110,97,109,101,44,32,116,104,101,32,112,97,
- 99,107,97,103,101,32,116,104,101,32,99,97,108,108,32,105,
- 115,10,32,32,32,32,98,101,105,110,103,32,109,97,100,101,
- 32,102,114,111,109,44,32,97,110,100,32,116,104,101,32,108,
- 101,118,101,108,32,97,100,106,117,115,116,109,101,110,116,46,
- 10,10,32,32,32,32,84,104,105,115,32,102,117,110,99,116,
- 105,111,110,32,114,101,112,114,101,115,101,110,116,115,32,116,
- 104,101,32,103,114,101,97,116,101,115,116,32,99,111,109,109,
- 111,110,32,100,101,110,111,109,105,110,97,116,111,114,32,111,
- 102,32,102,117,110,99,116,105,111,110,97,108,105,116,121,10,
- 32,32,32,32,98,101,116,119,101,101,110,32,105,109,112,111,
- 114,116,95,109,111,100,117,108,101,32,97,110,100,32,95,95,
- 105,109,112,111,114,116,95,95,46,32,84,104,105,115,32,105,
- 110,99,108,117,100,101,115,32,115,101,116,116,105,110,103,32,
- 95,95,112,97,99,107,97,103,101,95,95,32,105,102,10,32,
- 32,32,32,116,104,101,32,108,111,97,100,101,114,32,100,105,
- 100,32,110,111,116,46,10,10,32,32,32,32,114,25,0,0,
- 0,78,41,4,114,220,0,0,0,114,210,0,0,0,114,227,
- 0,0,0,218,11,95,103,99,100,95,105,109,112,111,114,116,
- 114,219,0,0,0,114,5,0,0,0,114,5,0,0,0,114,
- 6,0,0,0,114,228,0,0,0,7,4,0,0,115,10,0,
- 0,0,12,9,8,1,12,1,10,1,255,128,114,228,0,0,
- 0,169,1,218,9,114,101,99,117,114,115,105,118,101,99,3,
- 0,0,0,0,0,0,0,1,0,0,0,8,0,0,0,11,
- 0,0,0,67,0,0,0,115,218,0,0,0,124,1,68,0,
- 93,206,125,4,116,0,124,4,116,1,131,2,115,64,124,3,
- 114,34,124,0,106,2,100,1,23,0,125,5,110,4,100,2,
- 125,5,116,3,100,3,124,5,155,0,100,4,116,4,124,4,
- 131,1,106,2,155,0,157,4,131,1,130,1,124,4,100,5,
- 107,2,114,106,124,3,115,104,116,5,124,0,100,6,131,2,
- 114,104,116,6,124,0,124,0,106,7,124,2,100,7,100,8,
- 141,4,1,0,113,4,116,5,124,0,124,4,131,2,115,210,
- 100,9,160,8,124,0,106,2,124,4,161,2,125,6,122,14,
- 116,9,124,2,124,6,131,2,1,0,87,0,113,4,4,0,
- 116,10,121,216,1,0,125,7,1,0,122,42,124,7,106,11,
- 124,6,107,2,114,200,116,12,106,13,160,14,124,6,116,15,
- 161,2,100,10,117,1,114,200,87,0,89,0,100,10,125,7,
- 126,7,113,4,130,0,100,10,125,7,126,7,119,1,113,4,
- 124,0,83,0,119,0,41,11,122,238,70,105,103,117,114,101,
- 32,111,117,116,32,119,104,97,116,32,95,95,105,109,112,111,
- 114,116,95,95,32,115,104,111,117,108,100,32,114,101,116,117,
- 114,110,46,10,10,32,32,32,32,84,104,101,32,105,109,112,
- 111,114,116,95,32,112,97,114,97,109,101,116,101,114,32,105,
- 115,32,97,32,99,97,108,108,97,98,108,101,32,119,104,105,
- 99,104,32,116,97,107,101,115,32,116,104,101,32,110,97,109,
- 101,32,111,102,32,109,111,100,117,108,101,32,116,111,10,32,
- 32,32,32,105,109,112,111,114,116,46,32,73,116,32,105,115,
- 32,114,101,113,117,105,114,101,100,32,116,111,32,100,101,99,
- 111,117,112,108,101,32,116,104,101,32,102,117,110,99,116,105,
- 111,110,32,102,114,111,109,32,97,115,115,117,109,105,110,103,
- 32,105,109,112,111,114,116,108,105,98,39,115,10,32,32,32,
- 32,105,109,112,111,114,116,32,105,109,112,108,101,109,101,110,
- 116,97,116,105,111,110,32,105,115,32,100,101,115,105,114,101,
- 100,46,10,10,32,32,32,32,122,8,46,95,95,97,108,108,
- 95,95,122,13,96,96,102,114,111,109,32,108,105,115,116,39,
- 39,122,8,73,116,101,109,32,105,110,32,122,18,32,109,117,
- 115,116,32,98,101,32,115,116,114,44,32,110,111,116,32,250,
- 1,42,218,7,95,95,97,108,108,95,95,84,114,229,0,0,
- 0,114,205,0,0,0,78,41,16,114,215,0,0,0,114,216,
- 0,0,0,114,9,0,0,0,114,217,0,0,0,114,3,0,
- 0,0,114,11,0,0,0,218,16,95,104,97,110,100,108,101,
- 95,102,114,111,109,108,105,115,116,114,232,0,0,0,114,50,
- 0,0,0,114,74,0,0,0,114,223,0,0,0,114,20,0,
- 0,0,114,18,0,0,0,114,105,0,0,0,114,38,0,0,
- 0,114,226,0,0,0,41,8,114,110,0,0,0,218,8,102,
- 114,111,109,108,105,115,116,114,224,0,0,0,114,230,0,0,
- 0,218,1,120,90,5,119,104,101,114,101,90,9,102,114,111,
- 109,95,110,97,109,101,90,3,101,120,99,114,5,0,0,0,
- 114,5,0,0,0,114,6,0,0,0,114,233,0,0,0,22,
- 4,0,0,115,58,0,0,0,8,10,10,1,4,1,12,1,
- 4,2,10,1,8,1,8,255,8,2,14,1,10,1,2,1,
- 6,255,2,128,10,2,14,1,2,1,14,1,14,1,10,4,
- 16,1,2,255,12,2,2,1,8,128,2,245,4,12,2,248,
- 255,128,114,233,0,0,0,99,1,0,0,0,0,0,0,0,
- 0,0,0,0,3,0,0,0,6,0,0,0,67,0,0,0,
- 115,146,0,0,0,124,0,160,0,100,1,161,1,125,1,124,
- 0,160,0,100,2,161,1,125,2,124,1,100,3,117,1,114,
- 82,124,2,100,3,117,1,114,78,124,1,124,2,106,1,107,
- 3,114,78,116,2,106,3,100,4,124,1,155,2,100,5,124,
- 2,106,1,155,2,100,6,157,5,116,4,100,7,100,8,141,
- 3,1,0,124,1,83,0,124,2,100,3,117,1,114,96,124,
- 2,106,1,83,0,116,2,106,3,100,9,116,4,100,7,100,
- 8,141,3,1,0,124,0,100,10,25,0,125,1,100,11,124,
- 0,118,1,114,142,124,1,160,5,100,12,161,1,100,13,25,
- 0,125,1,124,1,83,0,41,14,122,167,67,97,108,99,117,
- 108,97,116,101,32,119,104,97,116,32,95,95,112,97,99,107,
- 97,103,101,95,95,32,115,104,111,117,108,100,32,98,101,46,
- 10,10,32,32,32,32,95,95,112,97,99,107,97,103,101,95,
- 95,32,105,115,32,110,111,116,32,103,117,97,114,97,110,116,
- 101,101,100,32,116,111,32,98,101,32,100,101,102,105,110,101,
- 100,32,111,114,32,99,111,117,108,100,32,98,101,32,115,101,
- 116,32,116,111,32,78,111,110,101,10,32,32,32,32,116,111,
- 32,114,101,112,114,101,115,101,110,116,32,116,104,97,116,32,
- 105,116,115,32,112,114,111,112,101,114,32,118,97,108,117,101,
- 32,105,115,32,117,110,107,110,111,119,110,46,10,10,32,32,
- 32,32,114,158,0,0,0,114,113,0,0,0,78,122,32,95,
- 95,112,97,99,107,97,103,101,95,95,32,33,61,32,95,95,
- 115,112,101,99,95,95,46,112,97,114,101,110,116,32,40,122,
- 4,32,33,61,32,250,1,41,233,3,0,0,0,41,1,90,
- 10,115,116,97,99,107,108,101,118,101,108,122,89,99,97,110,
- 39,116,32,114,101,115,111,108,118,101,32,112,97,99,107,97,
- 103,101,32,102,114,111,109,32,95,95,115,112,101,99,95,95,
- 32,111,114,32,95,95,112,97,99,107,97,103,101,95,95,44,
- 32,102,97,108,108,105,110,103,32,98,97,99,107,32,111,110,
- 32,95,95,110,97,109,101,95,95,32,97,110,100,32,95,95,
- 112,97,116,104,95,95,114,9,0,0,0,114,154,0,0,0,
- 114,141,0,0,0,114,25,0,0,0,41,6,114,38,0,0,
- 0,114,143,0,0,0,114,101,0,0,0,114,102,0,0,0,
- 114,169,0,0,0,114,142,0,0,0,41,3,218,7,103,108,
- 111,98,97,108,115,114,208,0,0,0,114,109,0,0,0,114,
- 5,0,0,0,114,5,0,0,0,114,6,0,0,0,218,17,
- 95,99,97,108,99,95,95,95,112,97,99,107,97,103,101,95,
- 95,59,4,0,0,115,44,0,0,0,10,7,10,1,8,1,
- 18,1,6,1,2,1,4,255,4,1,6,255,4,2,6,254,
- 4,3,8,1,6,1,6,2,4,2,6,254,8,3,8,1,
- 14,1,4,1,255,128,114,239,0,0,0,114,5,0,0,0,
- 99,5,0,0,0,0,0,0,0,0,0,0,0,9,0,0,
- 0,5,0,0,0,67,0,0,0,115,174,0,0,0,124,4,
- 100,1,107,2,114,18,116,0,124,0,131,1,125,5,110,36,
- 124,1,100,2,117,1,114,30,124,1,110,2,105,0,125,6,
- 116,1,124,6,131,1,125,7,116,0,124,0,124,7,124,4,
- 131,3,125,5,124,3,115,148,124,4,100,1,107,2,114,84,
- 116,0,124,0,160,2,100,3,161,1,100,1,25,0,131,1,
- 83,0,124,0,115,92,124,5,83,0,116,3,124,0,131,1,
- 116,3,124,0,160,2,100,3,161,1,100,1,25,0,131,1,
- 24,0,125,8,116,4,106,5,124,5,106,6,100,2,116,3,
- 124,5,106,6,131,1,124,8,24,0,133,2,25,0,25,0,
- 83,0,116,7,124,5,100,4,131,2,114,170,116,8,124,5,
- 124,3,116,0,131,3,83,0,124,5,83,0,41,5,97,215,
- 1,0,0,73,109,112,111,114,116,32,97,32,109,111,100,117,
- 108,101,46,10,10,32,32,32,32,84,104,101,32,39,103,108,
- 111,98,97,108,115,39,32,97,114,103,117,109,101,110,116,32,
- 105,115,32,117,115,101,100,32,116,111,32,105,110,102,101,114,
- 32,119,104,101,114,101,32,116,104,101,32,105,109,112,111,114,
- 116,32,105,115,32,111,99,99,117,114,114,105,110,103,32,102,
- 114,111,109,10,32,32,32,32,116,111,32,104,97,110,100,108,
- 101,32,114,101,108,97,116,105,118,101,32,105,109,112,111,114,
- 116,115,46,32,84,104,101,32,39,108,111,99,97,108,115,39,
- 32,97,114,103,117,109,101,110,116,32,105,115,32,105,103,110,
- 111,114,101,100,46,32,84,104,101,10,32,32,32,32,39,102,
- 114,111,109,108,105,115,116,39,32,97,114,103,117,109,101,110,
- 116,32,115,112,101,99,105,102,105,101,115,32,119,104,97,116,
- 32,115,104,111,117,108,100,32,101,120,105,115,116,32,97,115,
- 32,97,116,116,114,105,98,117,116,101,115,32,111,110,32,116,
- 104,101,32,109,111,100,117,108,101,10,32,32,32,32,98,101,
- 105,110,103,32,105,109,112,111,114,116,101,100,32,40,101,46,
- 103,46,32,96,96,102,114,111,109,32,109,111,100,117,108,101,
- 32,105,109,112,111,114,116,32,60,102,114,111,109,108,105,115,
- 116,62,96,96,41,46,32,32,84,104,101,32,39,108,101,118,
- 101,108,39,10,32,32,32,32,97,114,103,117,109,101,110,116,
- 32,114,101,112,114,101,115,101,110,116,115,32,116,104,101,32,
- 112,97,99,107,97,103,101,32,108,111,99,97,116,105,111,110,
- 32,116,111,32,105,109,112,111,114,116,32,102,114,111,109,32,
- 105,110,32,97,32,114,101,108,97,116,105,118,101,10,32,32,
- 32,32,105,109,112,111,114,116,32,40,101,46,103,46,32,96,
- 96,102,114,111,109,32,46,46,112,107,103,32,105,109,112,111,
- 114,116,32,109,111,100,96,96,32,119,111,117,108,100,32,104,
- 97,118,101,32,97,32,39,108,101,118,101,108,39,32,111,102,
- 32,50,41,46,10,10,32,32,32,32,114,25,0,0,0,78,
- 114,141,0,0,0,114,154,0,0,0,41,9,114,228,0,0,
- 0,114,239,0,0,0,218,9,112,97,114,116,105,116,105,111,
- 110,114,207,0,0,0,114,18,0,0,0,114,105,0,0,0,
- 114,9,0,0,0,114,11,0,0,0,114,233,0,0,0,41,
- 9,114,20,0,0,0,114,238,0,0,0,218,6,108,111,99,
- 97,108,115,114,234,0,0,0,114,209,0,0,0,114,110,0,
- 0,0,90,8,103,108,111,98,97,108,115,95,114,208,0,0,
- 0,90,7,99,117,116,95,111,102,102,114,5,0,0,0,114,
- 5,0,0,0,114,6,0,0,0,218,10,95,95,105,109,112,
- 111,114,116,95,95,86,4,0,0,115,32,0,0,0,8,11,
- 10,1,16,2,8,1,12,1,4,1,8,3,18,1,4,1,
- 4,1,26,4,30,3,10,1,12,1,4,2,255,128,114,242,
- 0,0,0,99,1,0,0,0,0,0,0,0,0,0,0,0,
- 2,0,0,0,3,0,0,0,67,0,0,0,115,38,0,0,
- 0,116,0,160,1,124,0,161,1,125,1,124,1,100,0,117,
- 0,114,30,116,2,100,1,124,0,23,0,131,1,130,1,116,
- 3,124,1,131,1,83,0,41,2,78,122,25,110,111,32,98,
- 117,105,108,116,45,105,110,32,109,111,100,117,108,101,32,110,
- 97,109,101,100,32,41,4,114,175,0,0,0,114,183,0,0,
- 0,114,87,0,0,0,114,173,0,0,0,41,2,114,20,0,
- 0,0,114,109,0,0,0,114,5,0,0,0,114,5,0,0,
- 0,114,6,0,0,0,218,18,95,98,117,105,108,116,105,110,
- 95,102,114,111,109,95,110,97,109,101,123,4,0,0,115,10,
- 0,0,0,10,1,8,1,12,1,8,1,255,128,114,243,0,
- 0,0,99,2,0,0,0,0,0,0,0,0,0,0,0,10,
- 0,0,0,5,0,0,0,67,0,0,0,115,166,0,0,0,
- 124,1,97,0,124,0,97,1,116,2,116,1,131,1,125,2,
- 116,1,106,3,160,4,161,0,68,0,93,72,92,2,125,3,
- 125,4,116,5,124,4,124,2,131,2,114,98,124,3,116,1,
- 106,6,118,0,114,60,116,7,125,5,110,18,116,0,160,8,
- 124,3,161,1,114,76,116,9,125,5,110,2,113,26,116,10,
- 124,4,124,5,131,2,125,6,116,11,124,6,124,4,131,2,
- 1,0,113,26,116,1,106,3,116,12,25,0,125,7,100,1,
- 68,0,93,46,125,8,124,8,116,1,106,3,118,1,114,138,
- 116,13,124,8,131,1,125,9,110,10,116,1,106,3,124,8,
- 25,0,125,9,116,14,124,7,124,8,124,9,131,3,1,0,
- 113,114,100,2,83,0,41,3,122,250,83,101,116,117,112,32,
- 105,109,112,111,114,116,108,105,98,32,98,121,32,105,109,112,
- 111,114,116,105,110,103,32,110,101,101,100,101,100,32,98,117,
- 105,108,116,45,105,110,32,109,111,100,117,108,101,115,32,97,
- 110,100,32,105,110,106,101,99,116,105,110,103,32,116,104,101,
- 109,10,32,32,32,32,105,110,116,111,32,116,104,101,32,103,
- 108,111,98,97,108,32,110,97,109,101,115,112,97,99,101,46,
- 10,10,32,32,32,32,65,115,32,115,121,115,32,105,115,32,
- 110,101,101,100,101,100,32,102,111,114,32,115,121,115,46,109,
- 111,100,117,108,101,115,32,97,99,99,101,115,115,32,97,110,
- 100,32,95,105,109,112,32,105,115,32,110,101,101,100,101,100,
- 32,116,111,32,108,111,97,100,32,98,117,105,108,116,45,105,
- 110,10,32,32,32,32,109,111,100,117,108,101,115,44,32,116,
- 104,111,115,101,32,116,119,111,32,109,111,100,117,108,101,115,
- 32,109,117,115,116,32,98,101,32,101,120,112,108,105,99,105,
- 116,108,121,32,112,97,115,115,101,100,32,105,110,46,10,10,
- 32,32,32,32,41,3,114,26,0,0,0,114,101,0,0,0,
- 114,71,0,0,0,78,41,15,114,64,0,0,0,114,18,0,
- 0,0,114,3,0,0,0,114,105,0,0,0,218,5,105,116,
- 101,109,115,114,215,0,0,0,114,86,0,0,0,114,175,0,
- 0,0,114,98,0,0,0,114,192,0,0,0,114,155,0,0,
- 0,114,161,0,0,0,114,9,0,0,0,114,243,0,0,0,
- 114,12,0,0,0,41,10,218,10,115,121,115,95,109,111,100,
- 117,108,101,218,11,95,105,109,112,95,109,111,100,117,108,101,
- 90,11,109,111,100,117,108,101,95,116,121,112,101,114,20,0,
- 0,0,114,110,0,0,0,114,122,0,0,0,114,109,0,0,
- 0,90,11,115,101,108,102,95,109,111,100,117,108,101,90,12,
- 98,117,105,108,116,105,110,95,110,97,109,101,90,14,98,117,
- 105,108,116,105,110,95,109,111,100,117,108,101,114,5,0,0,
- 0,114,5,0,0,0,114,6,0,0,0,218,6,95,115,101,
- 116,117,112,130,4,0,0,115,42,0,0,0,4,9,4,1,
- 8,3,18,1,10,1,10,1,6,1,10,1,6,1,2,2,
- 10,1,10,1,2,128,10,3,8,1,10,1,10,1,10,2,
- 14,1,4,251,255,128,114,247,0,0,0,99,2,0,0,0,
- 0,0,0,0,0,0,0,0,2,0,0,0,3,0,0,0,
- 67,0,0,0,115,38,0,0,0,116,0,124,0,124,1,131,
- 2,1,0,116,1,106,2,160,3,116,4,161,1,1,0,116,
- 1,106,2,160,3,116,5,161,1,1,0,100,1,83,0,41,
- 2,122,48,73,110,115,116,97,108,108,32,105,109,112,111,114,
- 116,101,114,115,32,102,111,114,32,98,117,105,108,116,105,110,
- 32,97,110,100,32,102,114,111,122,101,110,32,109,111,100,117,
- 108,101,115,78,41,6,114,247,0,0,0,114,18,0,0,0,
- 114,213,0,0,0,114,132,0,0,0,114,175,0,0,0,114,
- 192,0,0,0,41,2,114,245,0,0,0,114,246,0,0,0,
- 114,5,0,0,0,114,5,0,0,0,114,6,0,0,0,218,
- 8,95,105,110,115,116,97,108,108,165,4,0,0,115,8,0,
- 0,0,10,2,12,2,16,1,255,128,114,248,0,0,0,99,
- 0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,
- 4,0,0,0,67,0,0,0,115,32,0,0,0,100,1,100,
- 2,108,0,125,0,124,0,97,1,124,0,160,2,116,3,106,
- 4,116,5,25,0,161,1,1,0,100,2,83,0,41,3,122,
- 57,73,110,115,116,97,108,108,32,105,109,112,111,114,116,101,
- 114,115,32,116,104,97,116,32,114,101,113,117,105,114,101,32,
- 101,120,116,101,114,110,97,108,32,102,105,108,101,115,121,115,
- 116,101,109,32,97,99,99,101,115,115,114,25,0,0,0,78,
- 41,6,218,26,95,102,114,111,122,101,110,95,105,109,112,111,
- 114,116,108,105,98,95,101,120,116,101,114,110,97,108,114,139,
- 0,0,0,114,248,0,0,0,114,18,0,0,0,114,105,0,
- 0,0,114,9,0,0,0,41,1,114,249,0,0,0,114,5,
- 0,0,0,114,5,0,0,0,114,6,0,0,0,218,27,95,
- 105,110,115,116,97,108,108,95,101,120,116,101,114,110,97,108,
- 95,105,109,112,111,114,116,101,114,115,173,4,0,0,115,8,
- 0,0,0,8,3,4,1,20,1,255,128,114,250,0,0,0,
- 41,2,78,78,41,1,78,41,2,78,114,25,0,0,0,41,
- 4,78,78,114,5,0,0,0,114,25,0,0,0,41,54,114,
- 10,0,0,0,114,7,0,0,0,114,26,0,0,0,114,101,
- 0,0,0,114,71,0,0,0,114,139,0,0,0,114,17,0,
- 0,0,114,21,0,0,0,114,66,0,0,0,114,37,0,0,
- 0,114,47,0,0,0,114,22,0,0,0,114,23,0,0,0,
- 114,55,0,0,0,114,57,0,0,0,114,60,0,0,0,114,
- 72,0,0,0,114,74,0,0,0,114,83,0,0,0,114,95,
- 0,0,0,114,100,0,0,0,114,111,0,0,0,114,124,0,
- 0,0,114,125,0,0,0,114,104,0,0,0,114,155,0,0,
- 0,114,161,0,0,0,114,165,0,0,0,114,119,0,0,0,
- 114,106,0,0,0,114,172,0,0,0,114,173,0,0,0,114,
- 107,0,0,0,114,175,0,0,0,114,192,0,0,0,114,199,
- 0,0,0,114,210,0,0,0,114,212,0,0,0,114,214,0,
- 0,0,114,220,0,0,0,90,15,95,69,82,82,95,77,83,
- 71,95,80,82,69,70,73,88,114,222,0,0,0,114,225,0,
- 0,0,218,6,111,98,106,101,99,116,114,226,0,0,0,114,
- 227,0,0,0,114,228,0,0,0,114,233,0,0,0,114,239,
- 0,0,0,114,242,0,0,0,114,243,0,0,0,114,247,0,
- 0,0,114,248,0,0,0,114,250,0,0,0,114,5,0,0,
+ 10,95,102,105,110,100,95,115,112,101,99,147,3,0,0,115,
+ 66,0,0,0,6,2,8,1,8,2,4,3,12,1,10,5,
+ 8,1,8,1,2,1,10,1,14,1,12,1,8,1,16,1,
+ 4,255,12,3,30,128,10,1,18,2,10,1,2,1,10,1,
+ 14,1,12,4,10,2,8,1,8,2,8,2,2,239,4,19,
+ 2,243,2,244,255,128,114,214,0,0,0,99,3,0,0,0,
+ 0,0,0,0,0,0,0,0,3,0,0,0,5,0,0,0,
+ 67,0,0,0,115,110,0,0,0,116,0,124,0,116,1,131,
+ 2,115,28,116,2,100,1,160,3,116,4,124,0,131,1,161,
+ 1,131,1,130,1,124,2,100,2,107,0,114,44,116,5,100,
+ 3,131,1,130,1,124,2,100,2,107,4,114,82,116,0,124,
+ 1,116,1,131,2,115,70,116,2,100,4,131,1,130,1,124,
+ 1,115,82,116,6,100,5,131,1,130,1,124,0,115,106,124,
+ 2,100,2,107,2,114,102,116,5,100,6,131,1,130,1,100,
+ 7,83,0,100,7,83,0,41,8,122,28,86,101,114,105,102,
+ 121,32,97,114,103,117,109,101,110,116,115,32,97,114,101,32,
+ 34,115,97,110,101,34,46,122,31,109,111,100,117,108,101,32,
+ 110,97,109,101,32,109,117,115,116,32,98,101,32,115,116,114,
+ 44,32,110,111,116,32,123,125,114,25,0,0,0,122,18,108,
+ 101,118,101,108,32,109,117,115,116,32,98,101,32,62,61,32,
+ 48,122,31,95,95,112,97,99,107,97,103,101,95,95,32,110,
+ 111,116,32,115,101,116,32,116,111,32,97,32,115,116,114,105,
+ 110,103,122,54,97,116,116,101,109,112,116,101,100,32,114,101,
+ 108,97,116,105,118,101,32,105,109,112,111,114,116,32,119,105,
+ 116,104,32,110,111,32,107,110,111,119,110,32,112,97,114,101,
+ 110,116,32,112,97,99,107,97,103,101,122,17,69,109,112,116,
+ 121,32,109,111,100,117,108,101,32,110,97,109,101,78,41,7,
+ 218,10,105,115,105,110,115,116,97,110,99,101,218,3,115,116,
+ 114,218,9,84,121,112,101,69,114,114,111,114,114,50,0,0,
+ 0,114,3,0,0,0,218,10,86,97,108,117,101,69,114,114,
+ 111,114,114,87,0,0,0,169,3,114,20,0,0,0,114,208,
+ 0,0,0,114,209,0,0,0,114,5,0,0,0,114,5,0,
+ 0,0,114,6,0,0,0,218,13,95,115,97,110,105,116,121,
+ 95,99,104,101,99,107,194,3,0,0,115,26,0,0,0,10,
+ 2,18,1,8,1,8,1,8,1,10,1,8,1,4,1,8,
+ 1,12,2,8,1,8,255,255,128,114,220,0,0,0,122,16,
+ 78,111,32,109,111,100,117,108,101,32,110,97,109,101,100,32,
+ 122,4,123,33,114,125,99,2,0,0,0,0,0,0,0,0,
+ 0,0,0,9,0,0,0,8,0,0,0,67,0,0,0,115,
+ 22,1,0,0,100,0,125,2,124,0,160,0,100,1,161,1,
+ 100,2,25,0,125,3,124,3,114,128,124,3,116,1,106,2,
+ 118,1,114,42,116,3,124,1,124,3,131,2,1,0,124,0,
+ 116,1,106,2,118,0,114,62,116,1,106,2,124,0,25,0,
+ 83,0,116,1,106,2,124,3,25,0,125,4,122,10,124,4,
+ 106,4,125,2,87,0,110,44,4,0,116,5,144,1,121,20,
+ 1,0,1,0,1,0,116,6,100,3,23,0,160,7,124,0,
+ 124,3,161,2,125,5,116,8,124,5,124,0,100,4,141,2,
+ 100,0,130,2,116,9,124,0,124,2,131,2,125,6,124,6,
+ 100,0,117,0,114,164,116,8,116,6,160,7,124,0,161,1,
+ 124,0,100,4,141,2,130,1,116,10,124,6,131,1,125,7,
+ 124,3,144,1,114,14,116,1,106,2,124,3,25,0,125,4,
+ 124,0,160,0,100,1,161,1,100,5,25,0,125,8,122,18,
+ 116,11,124,4,124,8,124,7,131,3,1,0,87,0,124,7,
+ 83,0,4,0,116,5,144,1,121,18,1,0,1,0,1,0,
+ 100,6,124,3,155,2,100,7,124,8,155,2,157,4,125,5,
+ 116,12,160,13,124,5,116,14,161,2,1,0,89,0,124,7,
+ 83,0,124,7,83,0,119,0,119,0,41,8,78,114,141,0,
+ 0,0,114,25,0,0,0,122,23,59,32,123,33,114,125,32,
+ 105,115,32,110,111,116,32,97,32,112,97,99,107,97,103,101,
+ 114,19,0,0,0,233,2,0,0,0,122,27,67,97,110,110,
+ 111,116,32,115,101,116,32,97,110,32,97,116,116,114,105,98,
+ 117,116,101,32,111,110,32,122,18,32,102,111,114,32,99,104,
+ 105,108,100,32,109,111,100,117,108,101,32,41,15,114,142,0,
+ 0,0,114,18,0,0,0,114,105,0,0,0,114,74,0,0,
+ 0,114,154,0,0,0,114,2,0,0,0,218,8,95,69,82,
+ 82,95,77,83,71,114,50,0,0,0,218,19,77,111,100,117,
+ 108,101,78,111,116,70,111,117,110,100,69,114,114,111,114,114,
+ 214,0,0,0,114,173,0,0,0,114,12,0,0,0,114,101,
+ 0,0,0,114,102,0,0,0,114,169,0,0,0,41,9,114,
+ 20,0,0,0,218,7,105,109,112,111,114,116,95,114,181,0,
+ 0,0,114,143,0,0,0,90,13,112,97,114,101,110,116,95,
+ 109,111,100,117,108,101,114,108,0,0,0,114,109,0,0,0,
+ 114,110,0,0,0,90,5,99,104,105,108,100,114,5,0,0,
+ 0,114,5,0,0,0,114,6,0,0,0,218,23,95,102,105,
+ 110,100,95,97,110,100,95,108,111,97,100,95,117,110,108,111,
+ 99,107,101,100,213,3,0,0,115,60,0,0,0,4,1,14,
+ 1,4,1,10,1,10,1,10,2,10,1,10,1,2,1,10,
+ 1,14,1,16,1,14,1,10,1,8,1,18,1,8,2,6,
+ 1,10,2,14,1,2,1,14,1,4,4,14,253,16,1,14,
+ 1,8,1,2,253,2,242,255,128,114,225,0,0,0,99,2,
+ 0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,8,
+ 0,0,0,67,0,0,0,115,128,0,0,0,116,0,124,0,
+ 131,1,143,62,1,0,116,1,106,2,160,3,124,0,116,4,
+ 161,2,125,2,124,2,116,4,117,0,114,56,116,5,124,0,
+ 124,1,131,2,87,0,2,0,100,1,4,0,4,0,131,3,
+ 1,0,83,0,87,0,100,1,4,0,4,0,131,3,1,0,
+ 110,16,49,0,115,76,119,1,1,0,1,0,1,0,89,0,
+ 1,0,124,2,100,1,117,0,114,116,100,2,160,6,124,0,
+ 161,1,125,3,116,7,124,3,124,0,100,3,141,2,130,1,
+ 116,8,124,0,131,1,1,0,124,2,83,0,41,4,122,25,
+ 70,105,110,100,32,97,110,100,32,108,111,97,100,32,116,104,
+ 101,32,109,111,100,117,108,101,46,78,122,40,105,109,112,111,
+ 114,116,32,111,102,32,123,125,32,104,97,108,116,101,100,59,
+ 32,78,111,110,101,32,105,110,32,115,121,115,46,109,111,100,
+ 117,108,101,115,114,19,0,0,0,41,9,114,57,0,0,0,
+ 114,18,0,0,0,114,105,0,0,0,114,38,0,0,0,218,
+ 14,95,78,69,69,68,83,95,76,79,65,68,73,78,71,114,
+ 225,0,0,0,114,50,0,0,0,114,223,0,0,0,114,72,
+ 0,0,0,41,4,114,20,0,0,0,114,224,0,0,0,114,
+ 110,0,0,0,114,82,0,0,0,114,5,0,0,0,114,5,
+ 0,0,0,114,6,0,0,0,218,14,95,102,105,110,100,95,
+ 97,110,100,95,108,111,97,100,248,3,0,0,115,28,0,0,
+ 0,10,2,14,1,8,1,24,1,14,255,16,128,8,3,2,
+ 1,6,1,2,255,12,2,8,2,4,1,255,128,114,227,0,
+ 0,0,114,25,0,0,0,99,3,0,0,0,0,0,0,0,
+ 0,0,0,0,3,0,0,0,4,0,0,0,67,0,0,0,
+ 115,42,0,0,0,116,0,124,0,124,1,124,2,131,3,1,
+ 0,124,2,100,1,107,4,114,32,116,1,124,0,124,1,124,
+ 2,131,3,125,0,116,2,124,0,116,3,131,2,83,0,41,
+ 3,97,50,1,0,0,73,109,112,111,114,116,32,97,110,100,
+ 32,114,101,116,117,114,110,32,116,104,101,32,109,111,100,117,
+ 108,101,32,98,97,115,101,100,32,111,110,32,105,116,115,32,
+ 110,97,109,101,44,32,116,104,101,32,112,97,99,107,97,103,
+ 101,32,116,104,101,32,99,97,108,108,32,105,115,10,32,32,
+ 32,32,98,101,105,110,103,32,109,97,100,101,32,102,114,111,
+ 109,44,32,97,110,100,32,116,104,101,32,108,101,118,101,108,
+ 32,97,100,106,117,115,116,109,101,110,116,46,10,10,32,32,
+ 32,32,84,104,105,115,32,102,117,110,99,116,105,111,110,32,
+ 114,101,112,114,101,115,101,110,116,115,32,116,104,101,32,103,
+ 114,101,97,116,101,115,116,32,99,111,109,109,111,110,32,100,
+ 101,110,111,109,105,110,97,116,111,114,32,111,102,32,102,117,
+ 110,99,116,105,111,110,97,108,105,116,121,10,32,32,32,32,
+ 98,101,116,119,101,101,110,32,105,109,112,111,114,116,95,109,
+ 111,100,117,108,101,32,97,110,100,32,95,95,105,109,112,111,
+ 114,116,95,95,46,32,84,104,105,115,32,105,110,99,108,117,
+ 100,101,115,32,115,101,116,116,105,110,103,32,95,95,112,97,
+ 99,107,97,103,101,95,95,32,105,102,10,32,32,32,32,116,
+ 104,101,32,108,111,97,100,101,114,32,100,105,100,32,110,111,
+ 116,46,10,10,32,32,32,32,114,25,0,0,0,78,41,4,
+ 114,220,0,0,0,114,210,0,0,0,114,227,0,0,0,218,
+ 11,95,103,99,100,95,105,109,112,111,114,116,114,219,0,0,
0,114,5,0,0,0,114,5,0,0,0,114,6,0,0,0,
- 218,8,60,109,111,100,117,108,101,62,1,0,0,0,115,106,
- 0,0,0,4,0,8,22,4,9,4,1,4,1,4,3,8,
- 3,8,8,4,8,4,2,16,3,14,4,14,77,14,21,8,
- 16,8,37,8,17,14,11,8,8,8,11,8,12,8,19,14,
- 26,16,101,10,26,14,45,8,72,8,17,8,17,8,30,8,
- 36,8,45,14,15,14,77,14,82,8,13,8,9,10,9,8,
- 47,4,16,8,1,8,2,6,32,8,3,10,16,14,15,8,
- 37,10,27,8,37,8,7,8,35,12,8,255,128,
+ 114,228,0,0,0,8,4,0,0,115,10,0,0,0,12,9,
+ 8,1,12,1,10,1,255,128,114,228,0,0,0,169,1,218,
+ 9,114,101,99,117,114,115,105,118,101,99,3,0,0,0,0,
+ 0,0,0,1,0,0,0,8,0,0,0,11,0,0,0,67,
+ 0,0,0,115,218,0,0,0,124,1,68,0,93,206,125,4,
+ 116,0,124,4,116,1,131,2,115,64,124,3,114,34,124,0,
+ 106,2,100,1,23,0,125,5,110,4,100,2,125,5,116,3,
+ 100,3,124,5,155,0,100,4,116,4,124,4,131,1,106,2,
+ 155,0,157,4,131,1,130,1,124,4,100,5,107,2,114,106,
+ 124,3,115,104,116,5,124,0,100,6,131,2,114,104,116,6,
+ 124,0,124,0,106,7,124,2,100,7,100,8,141,4,1,0,
+ 113,4,116,5,124,0,124,4,131,2,115,210,100,9,160,8,
+ 124,0,106,2,124,4,161,2,125,6,122,14,116,9,124,2,
+ 124,6,131,2,1,0,87,0,113,4,4,0,116,10,121,216,
+ 1,0,125,7,1,0,122,42,124,7,106,11,124,6,107,2,
+ 114,200,116,12,106,13,160,14,124,6,116,15,161,2,100,10,
+ 117,1,114,200,87,0,89,0,100,10,125,7,126,7,113,4,
+ 130,0,100,10,125,7,126,7,119,1,113,4,124,0,83,0,
+ 119,0,41,11,122,238,70,105,103,117,114,101,32,111,117,116,
+ 32,119,104,97,116,32,95,95,105,109,112,111,114,116,95,95,
+ 32,115,104,111,117,108,100,32,114,101,116,117,114,110,46,10,
+ 10,32,32,32,32,84,104,101,32,105,109,112,111,114,116,95,
+ 32,112,97,114,97,109,101,116,101,114,32,105,115,32,97,32,
+ 99,97,108,108,97,98,108,101,32,119,104,105,99,104,32,116,
+ 97,107,101,115,32,116,104,101,32,110,97,109,101,32,111,102,
+ 32,109,111,100,117,108,101,32,116,111,10,32,32,32,32,105,
+ 109,112,111,114,116,46,32,73,116,32,105,115,32,114,101,113,
+ 117,105,114,101,100,32,116,111,32,100,101,99,111,117,112,108,
+ 101,32,116,104,101,32,102,117,110,99,116,105,111,110,32,102,
+ 114,111,109,32,97,115,115,117,109,105,110,103,32,105,109,112,
+ 111,114,116,108,105,98,39,115,10,32,32,32,32,105,109,112,
+ 111,114,116,32,105,109,112,108,101,109,101,110,116,97,116,105,
+ 111,110,32,105,115,32,100,101,115,105,114,101,100,46,10,10,
+ 32,32,32,32,122,8,46,95,95,97,108,108,95,95,122,13,
+ 96,96,102,114,111,109,32,108,105,115,116,39,39,122,8,73,
+ 116,101,109,32,105,110,32,122,18,32,109,117,115,116,32,98,
+ 101,32,115,116,114,44,32,110,111,116,32,250,1,42,218,7,
+ 95,95,97,108,108,95,95,84,114,229,0,0,0,114,205,0,
+ 0,0,78,41,16,114,215,0,0,0,114,216,0,0,0,114,
+ 9,0,0,0,114,217,0,0,0,114,3,0,0,0,114,11,
+ 0,0,0,218,16,95,104,97,110,100,108,101,95,102,114,111,
+ 109,108,105,115,116,114,232,0,0,0,114,50,0,0,0,114,
+ 74,0,0,0,114,223,0,0,0,114,20,0,0,0,114,18,
+ 0,0,0,114,105,0,0,0,114,38,0,0,0,114,226,0,
+ 0,0,41,8,114,110,0,0,0,218,8,102,114,111,109,108,
+ 105,115,116,114,224,0,0,0,114,230,0,0,0,218,1,120,
+ 90,5,119,104,101,114,101,90,9,102,114,111,109,95,110,97,
+ 109,101,90,3,101,120,99,114,5,0,0,0,114,5,0,0,
+ 0,114,6,0,0,0,114,233,0,0,0,23,4,0,0,115,
+ 58,0,0,0,8,10,10,1,4,1,12,1,4,2,10,1,
+ 8,1,8,255,8,2,14,1,10,1,2,1,6,255,2,128,
+ 10,2,14,1,2,1,14,1,14,1,10,4,16,1,2,255,
+ 12,2,2,1,8,128,2,245,4,12,2,248,255,128,114,233,
+ 0,0,0,99,1,0,0,0,0,0,0,0,0,0,0,0,
+ 3,0,0,0,6,0,0,0,67,0,0,0,115,146,0,0,
+ 0,124,0,160,0,100,1,161,1,125,1,124,0,160,0,100,
+ 2,161,1,125,2,124,1,100,3,117,1,114,82,124,2,100,
+ 3,117,1,114,78,124,1,124,2,106,1,107,3,114,78,116,
+ 2,106,3,100,4,124,1,155,2,100,5,124,2,106,1,155,
+ 2,100,6,157,5,116,4,100,7,100,8,141,3,1,0,124,
+ 1,83,0,124,2,100,3,117,1,114,96,124,2,106,1,83,
+ 0,116,2,106,3,100,9,116,4,100,7,100,8,141,3,1,
+ 0,124,0,100,10,25,0,125,1,100,11,124,0,118,1,114,
+ 142,124,1,160,5,100,12,161,1,100,13,25,0,125,1,124,
+ 1,83,0,41,14,122,167,67,97,108,99,117,108,97,116,101,
+ 32,119,104,97,116,32,95,95,112,97,99,107,97,103,101,95,
+ 95,32,115,104,111,117,108,100,32,98,101,46,10,10,32,32,
+ 32,32,95,95,112,97,99,107,97,103,101,95,95,32,105,115,
+ 32,110,111,116,32,103,117,97,114,97,110,116,101,101,100,32,
+ 116,111,32,98,101,32,100,101,102,105,110,101,100,32,111,114,
+ 32,99,111,117,108,100,32,98,101,32,115,101,116,32,116,111,
+ 32,78,111,110,101,10,32,32,32,32,116,111,32,114,101,112,
+ 114,101,115,101,110,116,32,116,104,97,116,32,105,116,115,32,
+ 112,114,111,112,101,114,32,118,97,108,117,101,32,105,115,32,
+ 117,110,107,110,111,119,110,46,10,10,32,32,32,32,114,158,
+ 0,0,0,114,113,0,0,0,78,122,32,95,95,112,97,99,
+ 107,97,103,101,95,95,32,33,61,32,95,95,115,112,101,99,
+ 95,95,46,112,97,114,101,110,116,32,40,122,4,32,33,61,
+ 32,250,1,41,233,3,0,0,0,41,1,90,10,115,116,97,
+ 99,107,108,101,118,101,108,122,89,99,97,110,39,116,32,114,
+ 101,115,111,108,118,101,32,112,97,99,107,97,103,101,32,102,
+ 114,111,109,32,95,95,115,112,101,99,95,95,32,111,114,32,
+ 95,95,112,97,99,107,97,103,101,95,95,44,32,102,97,108,
+ 108,105,110,103,32,98,97,99,107,32,111,110,32,95,95,110,
+ 97,109,101,95,95,32,97,110,100,32,95,95,112,97,116,104,
+ 95,95,114,9,0,0,0,114,154,0,0,0,114,141,0,0,
+ 0,114,25,0,0,0,41,6,114,38,0,0,0,114,143,0,
+ 0,0,114,101,0,0,0,114,102,0,0,0,114,169,0,0,
+ 0,114,142,0,0,0,41,3,218,7,103,108,111,98,97,108,
+ 115,114,208,0,0,0,114,109,0,0,0,114,5,0,0,0,
+ 114,5,0,0,0,114,6,0,0,0,218,17,95,99,97,108,
+ 99,95,95,95,112,97,99,107,97,103,101,95,95,60,4,0,
+ 0,115,44,0,0,0,10,7,10,1,8,1,18,1,6,1,
+ 2,1,4,255,4,1,6,255,4,2,6,254,4,3,8,1,
+ 6,1,6,2,4,2,6,254,8,3,8,1,14,1,4,1,
+ 255,128,114,239,0,0,0,114,5,0,0,0,99,5,0,0,
+ 0,0,0,0,0,0,0,0,0,9,0,0,0,5,0,0,
+ 0,67,0,0,0,115,174,0,0,0,124,4,100,1,107,2,
+ 114,18,116,0,124,0,131,1,125,5,110,36,124,1,100,2,
+ 117,1,114,30,124,1,110,2,105,0,125,6,116,1,124,6,
+ 131,1,125,7,116,0,124,0,124,7,124,4,131,3,125,5,
+ 124,3,115,148,124,4,100,1,107,2,114,84,116,0,124,0,
+ 160,2,100,3,161,1,100,1,25,0,131,1,83,0,124,0,
+ 115,92,124,5,83,0,116,3,124,0,131,1,116,3,124,0,
+ 160,2,100,3,161,1,100,1,25,0,131,1,24,0,125,8,
+ 116,4,106,5,124,5,106,6,100,2,116,3,124,5,106,6,
+ 131,1,124,8,24,0,133,2,25,0,25,0,83,0,116,7,
+ 124,5,100,4,131,2,114,170,116,8,124,5,124,3,116,0,
+ 131,3,83,0,124,5,83,0,41,5,97,215,1,0,0,73,
+ 109,112,111,114,116,32,97,32,109,111,100,117,108,101,46,10,
+ 10,32,32,32,32,84,104,101,32,39,103,108,111,98,97,108,
+ 115,39,32,97,114,103,117,109,101,110,116,32,105,115,32,117,
+ 115,101,100,32,116,111,32,105,110,102,101,114,32,119,104,101,
+ 114,101,32,116,104,101,32,105,109,112,111,114,116,32,105,115,
+ 32,111,99,99,117,114,114,105,110,103,32,102,114,111,109,10,
+ 32,32,32,32,116,111,32,104,97,110,100,108,101,32,114,101,
+ 108,97,116,105,118,101,32,105,109,112,111,114,116,115,46,32,
+ 84,104,101,32,39,108,111,99,97,108,115,39,32,97,114,103,
+ 117,109,101,110,116,32,105,115,32,105,103,110,111,114,101,100,
+ 46,32,84,104,101,10,32,32,32,32,39,102,114,111,109,108,
+ 105,115,116,39,32,97,114,103,117,109,101,110,116,32,115,112,
+ 101,99,105,102,105,101,115,32,119,104,97,116,32,115,104,111,
+ 117,108,100,32,101,120,105,115,116,32,97,115,32,97,116,116,
+ 114,105,98,117,116,101,115,32,111,110,32,116,104,101,32,109,
+ 111,100,117,108,101,10,32,32,32,32,98,101,105,110,103,32,
+ 105,109,112,111,114,116,101,100,32,40,101,46,103,46,32,96,
+ 96,102,114,111,109,32,109,111,100,117,108,101,32,105,109,112,
+ 111,114,116,32,60,102,114,111,109,108,105,115,116,62,96,96,
+ 41,46,32,32,84,104,101,32,39,108,101,118,101,108,39,10,
+ 32,32,32,32,97,114,103,117,109,101,110,116,32,114,101,112,
+ 114,101,115,101,110,116,115,32,116,104,101,32,112,97,99,107,
+ 97,103,101,32,108,111,99,97,116,105,111,110,32,116,111,32,
+ 105,109,112,111,114,116,32,102,114,111,109,32,105,110,32,97,
+ 32,114,101,108,97,116,105,118,101,10,32,32,32,32,105,109,
+ 112,111,114,116,32,40,101,46,103,46,32,96,96,102,114,111,
+ 109,32,46,46,112,107,103,32,105,109,112,111,114,116,32,109,
+ 111,100,96,96,32,119,111,117,108,100,32,104,97,118,101,32,
+ 97,32,39,108,101,118,101,108,39,32,111,102,32,50,41,46,
+ 10,10,32,32,32,32,114,25,0,0,0,78,114,141,0,0,
+ 0,114,154,0,0,0,41,9,114,228,0,0,0,114,239,0,
+ 0,0,218,9,112,97,114,116,105,116,105,111,110,114,207,0,
+ 0,0,114,18,0,0,0,114,105,0,0,0,114,9,0,0,
+ 0,114,11,0,0,0,114,233,0,0,0,41,9,114,20,0,
+ 0,0,114,238,0,0,0,218,6,108,111,99,97,108,115,114,
+ 234,0,0,0,114,209,0,0,0,114,110,0,0,0,90,8,
+ 103,108,111,98,97,108,115,95,114,208,0,0,0,90,7,99,
+ 117,116,95,111,102,102,114,5,0,0,0,114,5,0,0,0,
+ 114,6,0,0,0,218,10,95,95,105,109,112,111,114,116,95,
+ 95,87,4,0,0,115,32,0,0,0,8,11,10,1,16,2,
+ 8,1,12,1,4,1,8,3,18,1,4,1,4,1,26,4,
+ 30,3,10,1,12,1,4,2,255,128,114,242,0,0,0,99,
+ 1,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,
+ 3,0,0,0,67,0,0,0,115,38,0,0,0,116,0,160,
+ 1,124,0,161,1,125,1,124,1,100,0,117,0,114,30,116,
+ 2,100,1,124,0,23,0,131,1,130,1,116,3,124,1,131,
+ 1,83,0,41,2,78,122,25,110,111,32,98,117,105,108,116,
+ 45,105,110,32,109,111,100,117,108,101,32,110,97,109,101,100,
+ 32,41,4,114,175,0,0,0,114,183,0,0,0,114,87,0,
+ 0,0,114,173,0,0,0,41,2,114,20,0,0,0,114,109,
+ 0,0,0,114,5,0,0,0,114,5,0,0,0,114,6,0,
+ 0,0,218,18,95,98,117,105,108,116,105,110,95,102,114,111,
+ 109,95,110,97,109,101,124,4,0,0,115,10,0,0,0,10,
+ 1,8,1,12,1,8,1,255,128,114,243,0,0,0,99,2,
+ 0,0,0,0,0,0,0,0,0,0,0,10,0,0,0,5,
+ 0,0,0,67,0,0,0,115,166,0,0,0,124,1,97,0,
+ 124,0,97,1,116,2,116,1,131,1,125,2,116,1,106,3,
+ 160,4,161,0,68,0,93,72,92,2,125,3,125,4,116,5,
+ 124,4,124,2,131,2,114,98,124,3,116,1,106,6,118,0,
+ 114,60,116,7,125,5,110,18,116,0,160,8,124,3,161,1,
+ 114,76,116,9,125,5,110,2,113,26,116,10,124,4,124,5,
+ 131,2,125,6,116,11,124,6,124,4,131,2,1,0,113,26,
+ 116,1,106,3,116,12,25,0,125,7,100,1,68,0,93,46,
+ 125,8,124,8,116,1,106,3,118,1,114,138,116,13,124,8,
+ 131,1,125,9,110,10,116,1,106,3,124,8,25,0,125,9,
+ 116,14,124,7,124,8,124,9,131,3,1,0,113,114,100,2,
+ 83,0,41,3,122,250,83,101,116,117,112,32,105,109,112,111,
+ 114,116,108,105,98,32,98,121,32,105,109,112,111,114,116,105,
+ 110,103,32,110,101,101,100,101,100,32,98,117,105,108,116,45,
+ 105,110,32,109,111,100,117,108,101,115,32,97,110,100,32,105,
+ 110,106,101,99,116,105,110,103,32,116,104,101,109,10,32,32,
+ 32,32,105,110,116,111,32,116,104,101,32,103,108,111,98,97,
+ 108,32,110,97,109,101,115,112,97,99,101,46,10,10,32,32,
+ 32,32,65,115,32,115,121,115,32,105,115,32,110,101,101,100,
+ 101,100,32,102,111,114,32,115,121,115,46,109,111,100,117,108,
+ 101,115,32,97,99,99,101,115,115,32,97,110,100,32,95,105,
+ 109,112,32,105,115,32,110,101,101,100,101,100,32,116,111,32,
+ 108,111,97,100,32,98,117,105,108,116,45,105,110,10,32,32,
+ 32,32,109,111,100,117,108,101,115,44,32,116,104,111,115,101,
+ 32,116,119,111,32,109,111,100,117,108,101,115,32,109,117,115,
+ 116,32,98,101,32,101,120,112,108,105,99,105,116,108,121,32,
+ 112,97,115,115,101,100,32,105,110,46,10,10,32,32,32,32,
+ 41,3,114,26,0,0,0,114,101,0,0,0,114,71,0,0,
+ 0,78,41,15,114,64,0,0,0,114,18,0,0,0,114,3,
+ 0,0,0,114,105,0,0,0,218,5,105,116,101,109,115,114,
+ 215,0,0,0,114,86,0,0,0,114,175,0,0,0,114,98,
+ 0,0,0,114,192,0,0,0,114,155,0,0,0,114,161,0,
+ 0,0,114,9,0,0,0,114,243,0,0,0,114,12,0,0,
+ 0,41,10,218,10,115,121,115,95,109,111,100,117,108,101,218,
+ 11,95,105,109,112,95,109,111,100,117,108,101,90,11,109,111,
+ 100,117,108,101,95,116,121,112,101,114,20,0,0,0,114,110,
+ 0,0,0,114,122,0,0,0,114,109,0,0,0,90,11,115,
+ 101,108,102,95,109,111,100,117,108,101,90,12,98,117,105,108,
+ 116,105,110,95,110,97,109,101,90,14,98,117,105,108,116,105,
+ 110,95,109,111,100,117,108,101,114,5,0,0,0,114,5,0,
+ 0,0,114,6,0,0,0,218,6,95,115,101,116,117,112,131,
+ 4,0,0,115,42,0,0,0,4,9,4,1,8,3,18,1,
+ 10,1,10,1,6,1,10,1,6,1,2,2,10,1,10,1,
+ 2,128,10,3,8,1,10,1,10,1,10,2,14,1,4,251,
+ 255,128,114,247,0,0,0,99,2,0,0,0,0,0,0,0,
+ 0,0,0,0,2,0,0,0,3,0,0,0,67,0,0,0,
+ 115,38,0,0,0,116,0,124,0,124,1,131,2,1,0,116,
+ 1,106,2,160,3,116,4,161,1,1,0,116,1,106,2,160,
+ 3,116,5,161,1,1,0,100,1,83,0,41,2,122,48,73,
+ 110,115,116,97,108,108,32,105,109,112,111,114,116,101,114,115,
+ 32,102,111,114,32,98,117,105,108,116,105,110,32,97,110,100,
+ 32,102,114,111,122,101,110,32,109,111,100,117,108,101,115,78,
+ 41,6,114,247,0,0,0,114,18,0,0,0,114,213,0,0,
+ 0,114,132,0,0,0,114,175,0,0,0,114,192,0,0,0,
+ 41,2,114,245,0,0,0,114,246,0,0,0,114,5,0,0,
+ 0,114,5,0,0,0,114,6,0,0,0,218,8,95,105,110,
+ 115,116,97,108,108,166,4,0,0,115,8,0,0,0,10,2,
+ 12,2,16,1,255,128,114,248,0,0,0,99,0,0,0,0,
+ 0,0,0,0,0,0,0,0,1,0,0,0,4,0,0,0,
+ 67,0,0,0,115,32,0,0,0,100,1,100,2,108,0,125,
+ 0,124,0,97,1,124,0,160,2,116,3,106,4,116,5,25,
+ 0,161,1,1,0,100,2,83,0,41,3,122,57,73,110,115,
+ 116,97,108,108,32,105,109,112,111,114,116,101,114,115,32,116,
+ 104,97,116,32,114,101,113,117,105,114,101,32,101,120,116,101,
+ 114,110,97,108,32,102,105,108,101,115,121,115,116,101,109,32,
+ 97,99,99,101,115,115,114,25,0,0,0,78,41,6,218,26,
+ 95,102,114,111,122,101,110,95,105,109,112,111,114,116,108,105,
+ 98,95,101,120,116,101,114,110,97,108,114,139,0,0,0,114,
+ 248,0,0,0,114,18,0,0,0,114,105,0,0,0,114,9,
+ 0,0,0,41,1,114,249,0,0,0,114,5,0,0,0,114,
+ 5,0,0,0,114,6,0,0,0,218,27,95,105,110,115,116,
+ 97,108,108,95,101,120,116,101,114,110,97,108,95,105,109,112,
+ 111,114,116,101,114,115,174,4,0,0,115,8,0,0,0,8,
+ 3,4,1,20,1,255,128,114,250,0,0,0,41,2,78,78,
+ 41,1,78,41,2,78,114,25,0,0,0,41,4,78,78,114,
+ 5,0,0,0,114,25,0,0,0,41,54,114,10,0,0,0,
+ 114,7,0,0,0,114,26,0,0,0,114,101,0,0,0,114,
+ 71,0,0,0,114,139,0,0,0,114,17,0,0,0,114,21,
+ 0,0,0,114,66,0,0,0,114,37,0,0,0,114,47,0,
+ 0,0,114,22,0,0,0,114,23,0,0,0,114,55,0,0,
+ 0,114,57,0,0,0,114,60,0,0,0,114,72,0,0,0,
+ 114,74,0,0,0,114,83,0,0,0,114,95,0,0,0,114,
+ 100,0,0,0,114,111,0,0,0,114,124,0,0,0,114,125,
+ 0,0,0,114,104,0,0,0,114,155,0,0,0,114,161,0,
+ 0,0,114,165,0,0,0,114,119,0,0,0,114,106,0,0,
+ 0,114,172,0,0,0,114,173,0,0,0,114,107,0,0,0,
+ 114,175,0,0,0,114,192,0,0,0,114,199,0,0,0,114,
+ 210,0,0,0,114,212,0,0,0,114,214,0,0,0,114,220,
+ 0,0,0,90,15,95,69,82,82,95,77,83,71,95,80,82,
+ 69,70,73,88,114,222,0,0,0,114,225,0,0,0,218,6,
+ 111,98,106,101,99,116,114,226,0,0,0,114,227,0,0,0,
+ 114,228,0,0,0,114,233,0,0,0,114,239,0,0,0,114,
+ 242,0,0,0,114,243,0,0,0,114,247,0,0,0,114,248,
+ 0,0,0,114,250,0,0,0,114,5,0,0,0,114,5,0,
+ 0,0,114,5,0,0,0,114,6,0,0,0,218,8,60,109,
+ 111,100,117,108,101,62,1,0,0,0,115,106,0,0,0,4,
+ 0,8,22,4,9,4,1,4,1,4,3,8,3,8,8,4,
+ 8,4,2,16,3,14,4,14,77,14,21,8,16,8,37,8,
+ 17,14,11,8,8,8,11,8,12,8,19,14,26,16,101,10,
+ 26,14,45,8,72,8,17,8,17,8,30,8,36,8,45,14,
+ 15,14,77,14,82,8,13,8,9,10,10,8,47,4,16,8,
+ 1,8,2,6,32,8,3,10,16,14,15,8,37,10,27,8,
+ 37,8,7,8,35,12,8,255,128,
};
diff --git a/Python/importlib_external.h b/Python/importlib_external.h
index 934eebaf3a66e..9b5c720578ad7 100644
--- a/Python/importlib_external.h
+++ b/Python/importlib_external.h
@@ -2158,522 +2158,530 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = {
1,4,1,2,253,2,250,255,128,122,31,80,97,116,104,70,
105,110,100,101,114,46,95,112,97,116,104,95,105,109,112,111,
114,116,101,114,95,99,97,99,104,101,99,3,0,0,0,0,
- 0,0,0,0,0,0,0,6,0,0,0,4,0,0,0,67,
- 0,0,0,115,82,0,0,0,116,0,124,2,100,1,131,2,
+ 0,0,0,0,0,0,0,7,0,0,0,4,0,0,0,67,
+ 0,0,0,115,110,0,0,0,116,0,124,2,100,1,131,2,
114,26,124,2,160,1,124,1,161,1,92,2,125,3,125,4,
- 110,14,124,2,160,2,124,1,161,1,125,3,103,0,125,4,
- 124,3,100,0,117,1,114,60,116,3,160,4,124,1,124,3,
- 161,2,83,0,116,3,160,5,124,1,100,0,161,2,125,5,
- 124,4,124,5,95,6,124,5,83,0,41,2,78,114,148,0,
- 0,0,41,7,114,140,0,0,0,114,148,0,0,0,114,217,
- 0,0,0,114,146,0,0,0,114,212,0,0,0,114,194,0,
- 0,0,114,189,0,0,0,41,6,114,209,0,0,0,114,150,
+ 110,42,116,2,160,3,124,2,161,1,155,0,100,2,157,2,
+ 125,5,116,4,160,5,124,5,116,6,161,2,1,0,124,2,
+ 160,7,124,1,161,1,125,3,103,0,125,4,124,3,100,0,
+ 117,1,114,88,116,2,160,8,124,1,124,3,161,2,83,0,
+ 116,2,160,9,124,1,100,0,161,2,125,6,124,4,124,6,
+ 95,10,124,6,83,0,41,3,78,114,148,0,0,0,122,53,
+ 46,102,105,110,100,95,115,112,101,99,40,41,32,110,111,116,
+ 32,102,111,117,110,100,59,32,102,97,108,108,105,110,103,32,
+ 98,97,99,107,32,116,111,32,102,105,110,100,95,109,111,100,
+ 117,108,101,40,41,41,11,114,140,0,0,0,114,148,0,0,
+ 0,114,146,0,0,0,90,12,95,111,98,106,101,99,116,95,
+ 110,97,109,101,114,88,0,0,0,114,89,0,0,0,114,149,
+ 0,0,0,114,217,0,0,0,114,212,0,0,0,114,194,0,
+ 0,0,114,189,0,0,0,41,7,114,209,0,0,0,114,150,
0,0,0,114,68,1,0,0,114,151,0,0,0,114,152,0,
- 0,0,114,198,0,0,0,114,7,0,0,0,114,7,0,0,
- 0,114,8,0,0,0,218,16,95,108,101,103,97,99,121,95,
- 103,101,116,95,115,112,101,99,40,5,0,0,115,20,0,0,
- 0,10,4,16,1,10,2,4,1,8,1,12,1,12,1,6,
- 1,4,1,255,128,122,27,80,97,116,104,70,105,110,100,101,
- 114,46,95,108,101,103,97,99,121,95,103,101,116,95,115,112,
- 101,99,78,99,4,0,0,0,0,0,0,0,0,0,0,0,
- 9,0,0,0,5,0,0,0,67,0,0,0,115,166,0,0,
- 0,103,0,125,4,124,2,68,0,93,134,125,5,116,0,124,
- 5,116,1,116,2,102,2,131,2,115,28,113,8,124,0,160,
- 3,124,5,161,1,125,6,124,6,100,1,117,1,114,142,116,
- 4,124,6,100,2,131,2,114,70,124,6,160,5,124,1,124,
- 3,161,2,125,7,110,12,124,0,160,6,124,1,124,6,161,
- 2,125,7,124,7,100,1,117,0,114,92,113,8,124,7,106,
- 7,100,1,117,1,114,110,124,7,2,0,1,0,83,0,124,
- 7,106,8,125,8,124,8,100,1,117,0,114,132,116,9,100,
- 3,131,1,130,1,124,4,160,10,124,8,161,1,1,0,113,
- 8,116,11,160,12,124,1,100,1,161,2,125,7,124,4,124,
- 7,95,8,124,7,83,0,41,4,122,63,70,105,110,100,32,
- 116,104,101,32,108,111,97,100,101,114,32,111,114,32,110,97,
- 109,101,115,112,97,99,101,95,112,97,116,104,32,102,111,114,
- 32,116,104,105,115,32,109,111,100,117,108,101,47,112,97,99,
- 107,97,103,101,32,110,97,109,101,46,78,114,214,0,0,0,
- 122,19,115,112,101,99,32,109,105,115,115,105,110,103,32,108,
- 111,97,100,101,114,41,13,114,172,0,0,0,114,97,0,0,
- 0,218,5,98,121,116,101,115,114,73,1,0,0,114,140,0,
- 0,0,114,214,0,0,0,114,74,1,0,0,114,151,0,0,
- 0,114,189,0,0,0,114,129,0,0,0,114,178,0,0,0,
- 114,146,0,0,0,114,194,0,0,0,41,9,114,209,0,0,
- 0,114,150,0,0,0,114,58,0,0,0,114,213,0,0,0,
- 218,14,110,97,109,101,115,112,97,99,101,95,112,97,116,104,
- 90,5,101,110,116,114,121,114,68,1,0,0,114,198,0,0,
- 0,114,152,0,0,0,114,7,0,0,0,114,7,0,0,0,
- 114,8,0,0,0,218,9,95,103,101,116,95,115,112,101,99,
- 55,5,0,0,115,44,0,0,0,4,5,8,1,14,1,2,
- 1,10,1,8,1,10,1,14,1,12,2,8,1,2,1,10,
- 1,8,1,6,1,8,1,8,1,10,5,2,128,12,2,6,
- 1,4,1,255,128,122,20,80,97,116,104,70,105,110,100,101,
- 114,46,95,103,101,116,95,115,112,101,99,99,4,0,0,0,
- 0,0,0,0,0,0,0,0,6,0,0,0,5,0,0,0,
- 67,0,0,0,115,94,0,0,0,124,2,100,1,117,0,114,
- 14,116,0,106,1,125,2,124,0,160,2,124,1,124,2,124,
- 3,161,3,125,4,124,4,100,1,117,0,114,40,100,1,83,
- 0,124,4,106,3,100,1,117,0,114,90,124,4,106,4,125,
- 5,124,5,114,86,100,1,124,4,95,5,116,6,124,1,124,
- 5,124,0,106,2,131,3,124,4,95,4,124,4,83,0,100,
- 1,83,0,124,4,83,0,41,2,122,141,84,114,121,32,116,
- 111,32,102,105,110,100,32,97,32,115,112,101,99,32,102,111,
- 114,32,39,102,117,108,108,110,97,109,101,39,32,111,110,32,
- 115,121,115,46,112,97,116,104,32,111,114,32,39,112,97,116,
- 104,39,46,10,10,32,32,32,32,32,32,32,32,84,104,101,
- 32,115,101,97,114,99,104,32,105,115,32,98,97,115,101,100,
- 32,111,110,32,115,121,115,46,112,97,116,104,95,104,111,111,
- 107,115,32,97,110,100,32,115,121,115,46,112,97,116,104,95,
- 105,109,112,111,114,116,101,114,95,99,97,99,104,101,46,10,
- 32,32,32,32,32,32,32,32,78,41,7,114,16,0,0,0,
- 114,58,0,0,0,114,77,1,0,0,114,151,0,0,0,114,
- 189,0,0,0,114,192,0,0,0,114,33,1,0,0,41,6,
- 114,209,0,0,0,114,150,0,0,0,114,58,0,0,0,114,
- 213,0,0,0,114,198,0,0,0,114,76,1,0,0,114,7,
- 0,0,0,114,7,0,0,0,114,8,0,0,0,114,214,0,
- 0,0,87,5,0,0,115,28,0,0,0,8,6,6,1,14,
- 1,8,1,4,1,10,1,6,1,4,1,6,3,16,1,4,
- 1,4,2,4,2,255,128,122,20,80,97,116,104,70,105,110,
- 100,101,114,46,102,105,110,100,95,115,112,101,99,99,3,0,
- 0,0,0,0,0,0,0,0,0,0,4,0,0,0,4,0,
- 0,0,67,0,0,0,115,30,0,0,0,124,0,160,0,124,
- 1,124,2,161,2,125,3,124,3,100,1,117,0,114,24,100,
- 1,83,0,124,3,106,1,83,0,41,2,122,170,102,105,110,
- 100,32,116,104,101,32,109,111,100,117,108,101,32,111,110,32,
- 115,121,115,46,112,97,116,104,32,111,114,32,39,112,97,116,
- 104,39,32,98,97,115,101,100,32,111,110,32,115,121,115,46,
- 112,97,116,104,95,104,111,111,107,115,32,97,110,100,10,32,
- 32,32,32,32,32,32,32,115,121,115,46,112,97,116,104,95,
- 105,109,112,111,114,116,101,114,95,99,97,99,104,101,46,10,
- 10,32,32,32,32,32,32,32,32,84,104,105,115,32,109,101,
- 116,104,111,100,32,105,115,32,100,101,112,114,101,99,97,116,
- 101,100,46,32,32,85,115,101,32,102,105,110,100,95,115,112,
- 101,99,40,41,32,105,110,115,116,101,97,100,46,10,10,32,
- 32,32,32,32,32,32,32,78,114,215,0,0,0,114,216,0,
- 0,0,114,7,0,0,0,114,7,0,0,0,114,8,0,0,
- 0,114,217,0,0,0,111,5,0,0,115,10,0,0,0,12,
- 8,8,1,4,1,6,1,255,128,122,22,80,97,116,104,70,
- 105,110,100,101,114,46,102,105,110,100,95,109,111,100,117,108,
- 101,99,0,0,0,0,0,0,0,0,0,0,0,0,3,0,
- 0,0,4,0,0,0,79,0,0,0,115,28,0,0,0,100,
- 1,100,2,108,0,109,1,125,2,1,0,124,2,106,2,124,
- 0,105,0,124,1,164,1,142,1,83,0,41,4,97,32,1,
- 0,0,10,32,32,32,32,32,32,32,32,70,105,110,100,32,
- 100,105,115,116,114,105,98,117,116,105,111,110,115,46,10,10,
- 32,32,32,32,32,32,32,32,82,101,116,117,114,110,32,97,
- 110,32,105,116,101,114,97,98,108,101,32,111,102,32,97,108,
- 108,32,68,105,115,116,114,105,98,117,116,105,111,110,32,105,
- 110,115,116,97,110,99,101,115,32,99,97,112,97,98,108,101,
- 32,111,102,10,32,32,32,32,32,32,32,32,108,111,97,100,
- 105,110,103,32,116,104,101,32,109,101,116,97,100,97,116,97,
- 32,102,111,114,32,112,97,99,107,97,103,101,115,32,109,97,
- 116,99,104,105,110,103,32,96,96,99,111,110,116,101,120,116,
- 46,110,97,109,101,96,96,10,32,32,32,32,32,32,32,32,
- 40,111,114,32,97,108,108,32,110,97,109,101,115,32,105,102,
- 32,96,96,78,111,110,101,96,96,32,105,110,100,105,99,97,
- 116,101,100,41,32,97,108,111,110,103,32,116,104,101,32,112,
- 97,116,104,115,32,105,110,32,116,104,101,32,108,105,115,116,
- 10,32,32,32,32,32,32,32,32,111,102,32,100,105,114,101,
- 99,116,111,114,105,101,115,32,96,96,99,111,110,116,101,120,
- 116,46,112,97,116,104,96,96,46,10,32,32,32,32,32,32,
- 32,32,114,0,0,0,0,41,1,218,18,77,101,116,97,100,
- 97,116,97,80,97,116,104,70,105,110,100,101,114,78,41,3,
- 90,18,105,109,112,111,114,116,108,105,98,46,109,101,116,97,
- 100,97,116,97,114,78,1,0,0,218,18,102,105,110,100,95,
- 100,105,115,116,114,105,98,117,116,105,111,110,115,41,3,114,
- 131,0,0,0,114,132,0,0,0,114,78,1,0,0,114,7,
- 0,0,0,114,7,0,0,0,114,8,0,0,0,114,79,1,
- 0,0,124,5,0,0,115,6,0,0,0,12,10,16,1,255,
- 128,122,29,80,97,116,104,70,105,110,100,101,114,46,102,105,
- 110,100,95,100,105,115,116,114,105,98,117,116,105,111,110,115,
- 41,1,78,41,2,78,78,41,1,78,41,14,114,137,0,0,
- 0,114,136,0,0,0,114,138,0,0,0,114,139,0,0,0,
- 114,220,0,0,0,114,64,1,0,0,114,70,1,0,0,114,
- 221,0,0,0,114,73,1,0,0,114,74,1,0,0,114,77,
- 1,0,0,114,214,0,0,0,114,217,0,0,0,114,79,1,
- 0,0,114,7,0,0,0,114,7,0,0,0,114,7,0,0,
- 0,114,8,0,0,0,114,63,1,0,0,247,4,0,0,115,
- 38,0,0,0,8,0,4,2,2,2,10,1,2,9,10,1,
- 2,12,10,1,2,21,10,1,2,14,12,1,2,31,12,1,
- 2,23,12,1,2,12,14,1,255,128,114,63,1,0,0,99,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 3,0,0,0,64,0,0,0,115,90,0,0,0,101,0,90,
- 1,100,0,90,2,100,1,90,3,100,2,100,3,132,0,90,
- 4,100,4,100,5,132,0,90,5,101,6,90,7,100,6,100,
- 7,132,0,90,8,100,8,100,9,132,0,90,9,100,19,100,
- 11,100,12,132,1,90,10,100,13,100,14,132,0,90,11,101,
- 12,100,15,100,16,132,0,131,1,90,13,100,17,100,18,132,
- 0,90,14,100,10,83,0,41,20,218,10,70,105,108,101,70,
- 105,110,100,101,114,122,172,70,105,108,101,45,98,97,115,101,
- 100,32,102,105,110,100,101,114,46,10,10,32,32,32,32,73,
- 110,116,101,114,97,99,116,105,111,110,115,32,119,105,116,104,
- 32,116,104,101,32,102,105,108,101,32,115,121,115,116,101,109,
- 32,97,114,101,32,99,97,99,104,101,100,32,102,111,114,32,
- 112,101,114,102,111,114,109,97,110,99,101,44,32,98,101,105,
- 110,103,10,32,32,32,32,114,101,102,114,101,115,104,101,100,
- 32,119,104,101,110,32,116,104,101,32,100,105,114,101,99,116,
- 111,114,121,32,116,104,101,32,102,105,110,100,101,114,32,105,
- 115,32,104,97,110,100,108,105,110,103,32,104,97,115,32,98,
- 101,101,110,32,109,111,100,105,102,105,101,100,46,10,10,32,
- 32,32,32,99,2,0,0,0,0,0,0,0,0,0,0,0,
- 5,0,0,0,6,0,0,0,7,0,0,0,115,84,0,0,
- 0,103,0,125,3,124,2,68,0,93,32,92,2,137,0,125,
- 4,124,3,160,0,135,0,102,1,100,1,100,2,132,8,124,
- 4,68,0,131,1,161,1,1,0,113,8,124,3,124,0,95,
- 1,124,1,112,54,100,3,124,0,95,2,100,4,124,0,95,
- 3,116,4,131,0,124,0,95,5,116,4,131,0,124,0,95,
- 6,100,5,83,0,41,6,122,154,73,110,105,116,105,97,108,
- 105,122,101,32,119,105,116,104,32,116,104,101,32,112,97,116,
- 104,32,116,111,32,115,101,97,114,99,104,32,111,110,32,97,
- 110,100,32,97,32,118,97,114,105,97,98,108,101,32,110,117,
- 109,98,101,114,32,111,102,10,32,32,32,32,32,32,32,32,
- 50,45,116,117,112,108,101,115,32,99,111,110,116,97,105,110,
- 105,110,103,32,116,104,101,32,108,111,97,100,101,114,32,97,
- 110,100,32,116,104,101,32,102,105,108,101,32,115,117,102,102,
- 105,120,101,115,32,116,104,101,32,108,111,97,100,101,114,10,
- 32,32,32,32,32,32,32,32,114,101,99,111,103,110,105,122,
- 101,115,46,99,1,0,0,0,0,0,0,0,0,0,0,0,
- 2,0,0,0,3,0,0,0,51,0,0,0,115,22,0,0,
- 0,124,0,93,14,125,1,124,1,136,0,102,2,86,0,1,
- 0,113,2,100,0,83,0,114,121,0,0,0,114,7,0,0,
- 0,114,29,1,0,0,169,1,114,151,0,0,0,114,7,0,
- 0,0,114,8,0,0,0,114,9,0,0,0,153,5,0,0,
- 114,14,0,0,0,122,38,70,105,108,101,70,105,110,100,101,
- 114,46,95,95,105,110,105,116,95,95,46,60,108,111,99,97,
- 108,115,62,46,60,103,101,110,101,120,112,114,62,114,86,0,
- 0,0,114,116,0,0,0,78,41,7,114,178,0,0,0,218,
- 8,95,108,111,97,100,101,114,115,114,58,0,0,0,218,11,
- 95,112,97,116,104,95,109,116,105,109,101,218,3,115,101,116,
- 218,11,95,112,97,116,104,95,99,97,99,104,101,218,19,95,
- 114,101,108,97,120,101,100,95,112,97,116,104,95,99,97,99,
- 104,101,41,5,114,130,0,0,0,114,58,0,0,0,218,14,
- 108,111,97,100,101,114,95,100,101,116,97,105,108,115,90,7,
- 108,111,97,100,101,114,115,114,200,0,0,0,114,7,0,0,
- 0,114,81,1,0,0,114,8,0,0,0,114,223,0,0,0,
- 147,5,0,0,115,18,0,0,0,4,4,12,1,26,1,6,
- 1,10,2,6,1,8,1,12,1,255,128,122,19,70,105,108,
- 101,70,105,110,100,101,114,46,95,95,105,110,105,116,95,95,
- 99,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,
- 0,2,0,0,0,67,0,0,0,115,10,0,0,0,100,1,
- 124,0,95,0,100,2,83,0,41,3,122,31,73,110,118,97,
- 108,105,100,97,116,101,32,116,104,101,32,100,105,114,101,99,
- 116,111,114,121,32,109,116,105,109,101,46,114,116,0,0,0,
- 78,41,1,114,83,1,0,0,114,8,1,0,0,114,7,0,
- 0,0,114,7,0,0,0,114,8,0,0,0,114,64,1,0,
- 0,161,5,0,0,114,69,0,0,0,122,28,70,105,108,101,
- 70,105,110,100,101,114,46,105,110,118,97,108,105,100,97,116,
- 101,95,99,97,99,104,101,115,99,2,0,0,0,0,0,0,
- 0,0,0,0,0,3,0,0,0,3,0,0,0,67,0,0,
- 0,115,42,0,0,0,124,0,160,0,124,1,161,1,125,2,
- 124,2,100,1,117,0,114,26,100,1,103,0,102,2,83,0,
- 124,2,106,1,124,2,106,2,112,38,103,0,102,2,83,0,
- 41,2,122,197,84,114,121,32,116,111,32,102,105,110,100,32,
- 97,32,108,111,97,100,101,114,32,102,111,114,32,116,104,101,
- 32,115,112,101,99,105,102,105,101,100,32,109,111,100,117,108,
- 101,44,32,111,114,32,116,104,101,32,110,97,109,101,115,112,
- 97,99,101,10,32,32,32,32,32,32,32,32,112,97,99,107,
- 97,103,101,32,112,111,114,116,105,111,110,115,46,32,82,101,
- 116,117,114,110,115,32,40,108,111,97,100,101,114,44,32,108,
- 105,115,116,45,111,102,45,112,111,114,116,105,111,110,115,41,
- 46,10,10,32,32,32,32,32,32,32,32,84,104,105,115,32,
- 109,101,116,104,111,100,32,105,115,32,100,101,112,114,101,99,
- 97,116,101,100,46,32,32,85,115,101,32,102,105,110,100,95,
- 115,112,101,99,40,41,32,105,110,115,116,101,97,100,46,10,
- 10,32,32,32,32,32,32,32,32,78,41,3,114,214,0,0,
- 0,114,151,0,0,0,114,189,0,0,0,41,3,114,130,0,
- 0,0,114,150,0,0,0,114,198,0,0,0,114,7,0,0,
- 0,114,7,0,0,0,114,8,0,0,0,114,148,0,0,0,
- 167,5,0,0,115,10,0,0,0,10,7,8,1,8,1,16,
- 1,255,128,122,22,70,105,108,101,70,105,110,100,101,114,46,
- 102,105,110,100,95,108,111,97,100,101,114,99,6,0,0,0,
- 0,0,0,0,0,0,0,0,7,0,0,0,6,0,0,0,
- 67,0,0,0,115,26,0,0,0,124,1,124,2,124,3,131,
- 2,125,6,116,0,124,2,124,3,124,6,124,4,100,1,141,
- 4,83,0,41,2,78,114,188,0,0,0,41,1,114,201,0,
- 0,0,41,7,114,130,0,0,0,114,199,0,0,0,114,150,
- 0,0,0,114,58,0,0,0,90,4,115,109,115,108,114,213,
- 0,0,0,114,151,0,0,0,114,7,0,0,0,114,7,0,
- 0,0,114,8,0,0,0,114,77,1,0,0,179,5,0,0,
- 115,10,0,0,0,10,1,8,1,2,1,6,255,255,128,122,
- 20,70,105,108,101,70,105,110,100,101,114,46,95,103,101,116,
- 95,115,112,101,99,78,99,3,0,0,0,0,0,0,0,0,
- 0,0,0,14,0,0,0,8,0,0,0,67,0,0,0,115,
- 100,1,0,0,100,1,125,3,124,1,160,0,100,2,161,1,
- 100,3,25,0,125,4,122,24,116,1,124,0,106,2,112,34,
- 116,3,160,4,161,0,131,1,106,5,125,5,87,0,110,20,
- 4,0,116,6,144,1,121,98,1,0,1,0,1,0,100,4,
- 125,5,89,0,124,5,124,0,106,7,107,3,114,88,124,0,
- 160,8,161,0,1,0,124,5,124,0,95,7,116,9,131,0,
- 114,110,124,0,106,10,125,6,124,4,160,11,161,0,125,7,
- 110,10,124,0,106,12,125,6,124,4,125,7,124,7,124,6,
- 118,0,114,214,116,13,124,0,106,2,124,4,131,2,125,8,
- 124,0,106,14,68,0,93,58,92,2,125,9,125,10,100,5,
- 124,9,23,0,125,11,116,13,124,8,124,11,131,2,125,12,
- 116,15,124,12,131,1,114,204,124,0,160,16,124,10,124,1,
- 124,12,124,8,103,1,124,2,161,5,2,0,1,0,83,0,
- 113,146,116,17,124,8,131,1,125,3,124,0,106,14,68,0,
- 93,86,92,2,125,9,125,10,116,13,124,0,106,2,124,4,
- 124,9,23,0,131,2,125,12,116,18,106,19,100,6,124,12,
- 100,3,100,7,141,3,1,0,124,7,124,9,23,0,124,6,
- 118,0,144,1,114,50,116,15,124,12,131,1,144,1,114,50,
- 124,0,160,16,124,10,124,1,124,12,100,8,124,2,161,5,
- 2,0,1,0,83,0,113,220,124,3,144,1,114,94,116,18,
- 160,19,100,9,124,8,161,2,1,0,116,18,160,20,124,1,
- 100,8,161,2,125,13,124,8,103,1,124,13,95,21,124,13,
- 83,0,100,8,83,0,119,0,41,10,122,111,84,114,121,32,
- 116,111,32,102,105,110,100,32,97,32,115,112,101,99,32,102,
- 111,114,32,116,104,101,32,115,112,101,99,105,102,105,101,100,
- 32,109,111,100,117,108,101,46,10,10,32,32,32,32,32,32,
- 32,32,82,101,116,117,114,110,115,32,116,104,101,32,109,97,
- 116,99,104,105,110,103,32,115,112,101,99,44,32,111,114,32,
- 78,111,110,101,32,105,102,32,110,111,116,32,102,111,117,110,
- 100,46,10,32,32,32,32,32,32,32,32,70,114,86,0,0,
- 0,114,45,0,0,0,114,116,0,0,0,114,223,0,0,0,
- 122,9,116,114,121,105,110,103,32,123,125,41,1,90,9,118,
- 101,114,98,111,115,105,116,121,78,122,25,112,111,115,115,105,
- 98,108,101,32,110,97,109,101,115,112,97,99,101,32,102,111,
- 114,32,123,125,41,22,114,55,0,0,0,114,63,0,0,0,
- 114,58,0,0,0,114,19,0,0,0,114,70,0,0,0,114,
- 22,1,0,0,114,64,0,0,0,114,83,1,0,0,218,11,
- 95,102,105,108,108,95,99,97,99,104,101,114,22,0,0,0,
- 114,86,1,0,0,114,117,0,0,0,114,85,1,0,0,114,
- 54,0,0,0,114,82,1,0,0,114,68,0,0,0,114,77,
- 1,0,0,114,71,0,0,0,114,146,0,0,0,114,160,0,
- 0,0,114,194,0,0,0,114,189,0,0,0,41,14,114,130,
- 0,0,0,114,150,0,0,0,114,213,0,0,0,90,12,105,
- 115,95,110,97,109,101,115,112,97,99,101,90,11,116,97,105,
- 108,95,109,111,100,117,108,101,114,180,0,0,0,90,5,99,
- 97,99,104,101,90,12,99,97,99,104,101,95,109,111,100,117,
- 108,101,90,9,98,97,115,101,95,112,97,116,104,114,30,1,
- 0,0,114,199,0,0,0,90,13,105,110,105,116,95,102,105,
- 108,101,110,97,109,101,90,9,102,117,108,108,95,112,97,116,
- 104,114,198,0,0,0,114,7,0,0,0,114,7,0,0,0,
- 114,8,0,0,0,114,214,0,0,0,184,5,0,0,115,80,
- 0,0,0,4,5,14,1,2,1,24,1,14,1,6,1,10,
- 1,8,1,6,1,6,2,6,1,10,1,6,2,4,1,8,
- 2,12,1,14,1,8,1,10,1,8,1,24,1,2,255,8,
- 5,14,2,16,1,16,1,14,1,10,1,10,1,4,1,8,
- 255,2,128,6,2,12,1,12,1,8,1,4,1,4,1,2,
- 219,255,128,122,20,70,105,108,101,70,105,110,100,101,114,46,
- 102,105,110,100,95,115,112,101,99,99,1,0,0,0,0,0,
- 0,0,0,0,0,0,9,0,0,0,10,0,0,0,67,0,
- 0,0,115,190,0,0,0,124,0,106,0,125,1,122,22,116,
- 1,160,2,124,1,112,22,116,1,160,3,161,0,161,1,125,
- 2,87,0,110,24,4,0,116,4,116,5,116,6,102,3,121,
- 188,1,0,1,0,1,0,103,0,125,2,89,0,116,7,106,
- 8,160,9,100,1,161,1,115,78,116,10,124,2,131,1,124,
- 0,95,11,110,74,116,10,131,0,125,3,124,2,68,0,93,
- 56,125,4,124,4,160,12,100,2,161,1,92,3,125,5,125,
- 6,125,7,124,6,114,130,100,3,160,13,124,5,124,7,160,
- 14,161,0,161,2,125,8,110,4,124,5,125,8,124,3,160,
- 15,124,8,161,1,1,0,113,88,124,3,124,0,95,11,116,
- 7,106,8,160,9,116,16,161,1,114,184,100,4,100,5,132,
- 0,124,2,68,0,131,1,124,0,95,17,100,6,83,0,100,
- 6,83,0,119,0,41,7,122,68,70,105,108,108,32,116,104,
- 101,32,99,97,99,104,101,32,111,102,32,112,111,116,101,110,
- 116,105,97,108,32,109,111,100,117,108,101,115,32,97,110,100,
- 32,112,97,99,107,97,103,101,115,32,102,111,114,32,116,104,
- 105,115,32,100,105,114,101,99,116,111,114,121,46,114,15,0,
- 0,0,114,86,0,0,0,114,76,0,0,0,99,1,0,0,
- 0,0,0,0,0,0,0,0,0,2,0,0,0,4,0,0,
- 0,83,0,0,0,115,20,0,0,0,104,0,124,0,93,12,
- 125,1,124,1,160,0,161,0,146,2,113,4,83,0,114,7,
- 0,0,0,41,1,114,117,0,0,0,41,2,114,5,0,0,
- 0,90,2,102,110,114,7,0,0,0,114,7,0,0,0,114,
- 8,0,0,0,114,13,0,0,0,5,6,0,0,115,4,0,
- 0,0,20,0,255,128,122,41,70,105,108,101,70,105,110,100,
- 101,114,46,95,102,105,108,108,95,99,97,99,104,101,46,60,
- 108,111,99,97,108,115,62,46,60,115,101,116,99,111,109,112,
- 62,78,41,18,114,58,0,0,0,114,19,0,0,0,90,7,
- 108,105,115,116,100,105,114,114,70,0,0,0,114,71,1,0,
- 0,218,15,80,101,114,109,105,115,115,105,111,110,69,114,114,
- 111,114,218,18,78,111,116,65,68,105,114,101,99,116,111,114,
- 121,69,114,114,111,114,114,16,0,0,0,114,26,0,0,0,
- 114,27,0,0,0,114,84,1,0,0,114,85,1,0,0,114,
- 112,0,0,0,114,77,0,0,0,114,117,0,0,0,218,3,
- 97,100,100,114,28,0,0,0,114,86,1,0,0,41,9,114,
- 130,0,0,0,114,58,0,0,0,90,8,99,111,110,116,101,
- 110,116,115,90,21,108,111,119,101,114,95,115,117,102,102,105,
- 120,95,99,111,110,116,101,110,116,115,114,56,1,0,0,114,
- 128,0,0,0,114,40,1,0,0,114,30,1,0,0,90,8,
- 110,101,119,95,110,97,109,101,114,7,0,0,0,114,7,0,
- 0,0,114,8,0,0,0,114,88,1,0,0,232,5,0,0,
- 115,40,0,0,0,6,2,2,1,22,1,18,1,6,3,12,
- 3,12,1,6,7,8,1,16,1,4,1,18,1,4,2,12,
- 1,6,1,12,1,20,1,4,255,2,233,255,128,122,22,70,
- 105,108,101,70,105,110,100,101,114,46,95,102,105,108,108,95,
- 99,97,99,104,101,99,1,0,0,0,0,0,0,0,0,0,
- 0,0,3,0,0,0,3,0,0,0,7,0,0,0,115,18,
- 0,0,0,135,0,135,1,102,2,100,1,100,2,132,8,125,
- 2,124,2,83,0,41,4,97,20,1,0,0,65,32,99,108,
- 97,115,115,32,109,101,116,104,111,100,32,119,104,105,99,104,
- 32,114,101,116,117,114,110,115,32,97,32,99,108,111,115,117,
- 114,101,32,116,111,32,117,115,101,32,111,110,32,115,121,115,
- 46,112,97,116,104,95,104,111,111,107,10,32,32,32,32,32,
- 32,32,32,119,104,105,99,104,32,119,105,108,108,32,114,101,
- 116,117,114,110,32,97,110,32,105,110,115,116,97,110,99,101,
- 32,117,115,105,110,103,32,116,104,101,32,115,112,101,99,105,
- 102,105,101,100,32,108,111,97,100,101,114,115,32,97,110,100,
- 32,116,104,101,32,112,97,116,104,10,32,32,32,32,32,32,
- 32,32,99,97,108,108,101,100,32,111,110,32,116,104,101,32,
- 99,108,111,115,117,114,101,46,10,10,32,32,32,32,32,32,
- 32,32,73,102,32,116,104,101,32,112,97,116,104,32,99,97,
- 108,108,101,100,32,111,110,32,116,104,101,32,99,108,111,115,
- 117,114,101,32,105,115,32,110,111,116,32,97,32,100,105,114,
- 101,99,116,111,114,121,44,32,73,109,112,111,114,116,69,114,
- 114,111,114,32,105,115,10,32,32,32,32,32,32,32,32,114,
- 97,105,115,101,100,46,10,10,32,32,32,32,32,32,32,32,
- 99,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,
- 0,4,0,0,0,19,0,0,0,115,36,0,0,0,116,0,
- 124,0,131,1,115,20,116,1,100,1,124,0,100,2,141,2,
- 130,1,136,0,124,0,103,1,136,1,162,1,82,0,142,0,
- 83,0,41,4,122,45,80,97,116,104,32,104,111,111,107,32,
- 102,111,114,32,105,109,112,111,114,116,108,105,98,46,109,97,
- 99,104,105,110,101,114,121,46,70,105,108,101,70,105,110,100,
- 101,114,46,122,30,111,110,108,121,32,100,105,114,101,99,116,
- 111,114,105,101,115,32,97,114,101,32,115,117,112,112,111,114,
- 116,101,100,114,62,0,0,0,78,41,2,114,71,0,0,0,
- 114,129,0,0,0,114,62,0,0,0,169,2,114,209,0,0,
- 0,114,87,1,0,0,114,7,0,0,0,114,8,0,0,0,
- 218,24,112,97,116,104,95,104,111,111,107,95,102,111,114,95,
- 70,105,108,101,70,105,110,100,101,114,17,6,0,0,115,8,
- 0,0,0,8,2,12,1,16,1,255,128,122,54,70,105,108,
- 101,70,105,110,100,101,114,46,112,97,116,104,95,104,111,111,
- 107,46,60,108,111,99,97,108,115,62,46,112,97,116,104,95,
- 104,111,111,107,95,102,111,114,95,70,105,108,101,70,105,110,
- 100,101,114,78,114,7,0,0,0,41,3,114,209,0,0,0,
- 114,87,1,0,0,114,93,1,0,0,114,7,0,0,0,114,
- 92,1,0,0,114,8,0,0,0,218,9,112,97,116,104,95,
- 104,111,111,107,7,6,0,0,115,6,0,0,0,14,10,4,
- 6,255,128,122,20,70,105,108,101,70,105,110,100,101,114,46,
- 112,97,116,104,95,104,111,111,107,99,1,0,0,0,0,0,
- 0,0,0,0,0,0,1,0,0,0,3,0,0,0,67,0,
- 0,0,114,53,1,0,0,41,2,78,122,16,70,105,108,101,
- 70,105,110,100,101,114,40,123,33,114,125,41,41,2,114,77,
- 0,0,0,114,58,0,0,0,114,8,1,0,0,114,7,0,
- 0,0,114,7,0,0,0,114,8,0,0,0,114,54,1,0,
- 0,25,6,0,0,114,47,1,0,0,122,19,70,105,108,101,
- 70,105,110,100,101,114,46,95,95,114,101,112,114,95,95,41,
- 1,78,41,15,114,137,0,0,0,114,136,0,0,0,114,138,
- 0,0,0,114,139,0,0,0,114,223,0,0,0,114,64,1,
- 0,0,114,154,0,0,0,114,217,0,0,0,114,148,0,0,
- 0,114,77,1,0,0,114,214,0,0,0,114,88,1,0,0,
- 114,221,0,0,0,114,94,1,0,0,114,54,1,0,0,114,
- 7,0,0,0,114,7,0,0,0,114,7,0,0,0,114,8,
- 0,0,0,114,80,1,0,0,138,5,0,0,115,26,0,0,
- 0,8,0,4,2,8,7,8,14,4,4,8,2,8,12,10,
- 5,8,48,2,31,10,1,12,17,255,128,114,80,1,0,0,
- 99,4,0,0,0,0,0,0,0,0,0,0,0,6,0,0,
- 0,8,0,0,0,67,0,0,0,115,144,0,0,0,124,0,
- 160,0,100,1,161,1,125,4,124,0,160,0,100,2,161,1,
- 125,5,124,4,115,66,124,5,114,36,124,5,106,1,125,4,
- 110,30,124,2,124,3,107,2,114,56,116,2,124,1,124,2,
- 131,2,125,4,110,10,116,3,124,1,124,2,131,2,125,4,
- 124,5,115,84,116,4,124,1,124,2,124,4,100,3,141,3,
- 125,5,122,38,124,5,124,0,100,2,60,0,124,4,124,0,
- 100,1,60,0,124,2,124,0,100,4,60,0,124,3,124,0,
- 100,5,60,0,87,0,100,0,83,0,4,0,116,5,121,142,
- 1,0,1,0,1,0,89,0,100,0,83,0,119,0,41,6,
- 78,218,10,95,95,108,111,97,100,101,114,95,95,218,8,95,
- 95,115,112,101,99,95,95,114,81,1,0,0,90,8,95,95,
- 102,105,108,101,95,95,90,10,95,95,99,97,99,104,101,100,
- 95,95,41,6,218,3,103,101,116,114,151,0,0,0,114,27,
- 1,0,0,114,21,1,0,0,114,201,0,0,0,218,9,69,
- 120,99,101,112,116,105,111,110,41,6,90,2,110,115,114,128,
- 0,0,0,90,8,112,97,116,104,110,97,109,101,90,9,99,
- 112,97,116,104,110,97,109,101,114,151,0,0,0,114,198,0,
- 0,0,114,7,0,0,0,114,7,0,0,0,114,8,0,0,
- 0,218,14,95,102,105,120,95,117,112,95,109,111,100,117,108,
- 101,31,6,0,0,115,38,0,0,0,10,2,10,1,4,1,
- 4,1,8,1,8,1,12,1,10,2,4,1,14,1,2,1,
- 8,1,8,1,8,1,14,1,12,1,6,2,2,254,255,128,
- 114,99,1,0,0,99,0,0,0,0,0,0,0,0,0,0,
- 0,0,3,0,0,0,3,0,0,0,67,0,0,0,115,38,
- 0,0,0,116,0,116,1,160,2,161,0,102,2,125,0,116,
- 3,116,4,102,2,125,1,116,5,116,6,102,2,125,2,124,
- 0,124,1,124,2,103,3,83,0,41,2,122,95,82,101,116,
- 117,114,110,115,32,97,32,108,105,115,116,32,111,102,32,102,
- 105,108,101,45,98,97,115,101,100,32,109,111,100,117,108,101,
- 32,108,111,97,100,101,114,115,46,10,10,32,32,32,32,69,
- 97,99,104,32,105,116,101,109,32,105,115,32,97,32,116,117,
- 112,108,101,32,40,108,111,97,100,101,114,44,32,115,117,102,
- 102,105,120,101,115,41,46,10,32,32,32,32,78,41,7,114,
- 17,1,0,0,114,174,0,0,0,218,18,101,120,116,101,110,
- 115,105,111,110,95,115,117,102,102,105,120,101,115,114,21,1,
- 0,0,114,113,0,0,0,114,27,1,0,0,114,101,0,0,
- 0,41,3,90,10,101,120,116,101,110,115,105,111,110,115,90,
- 6,115,111,117,114,99,101,90,8,98,121,116,101,99,111,100,
- 101,114,7,0,0,0,114,7,0,0,0,114,8,0,0,0,
- 114,195,0,0,0,54,6,0,0,115,10,0,0,0,12,5,
- 8,1,8,1,10,1,255,128,114,195,0,0,0,99,1,0,
- 0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,
- 0,0,67,0,0,0,115,8,0,0,0,124,0,97,0,100,
- 0,83,0,114,121,0,0,0,41,1,114,146,0,0,0,41,
- 1,218,17,95,98,111,111,116,115,116,114,97,112,95,109,111,
- 100,117,108,101,114,7,0,0,0,114,7,0,0,0,114,8,
- 0,0,0,218,21,95,115,101,116,95,98,111,111,116,115,116,
- 114,97,112,95,109,111,100,117,108,101,65,6,0,0,115,4,
- 0,0,0,8,2,255,128,114,102,1,0,0,99,1,0,0,
- 0,0,0,0,0,0,0,0,0,2,0,0,0,4,0,0,
- 0,67,0,0,0,115,50,0,0,0,116,0,124,0,131,1,
- 1,0,116,1,131,0,125,1,116,2,106,3,160,4,116,5,
- 106,6,124,1,142,0,103,1,161,1,1,0,116,2,106,7,
- 160,8,116,9,161,1,1,0,100,1,83,0,41,2,122,41,
- 73,110,115,116,97,108,108,32,116,104,101,32,112,97,116,104,
- 45,98,97,115,101,100,32,105,109,112,111,114,116,32,99,111,
- 109,112,111,110,101,110,116,115,46,78,41,10,114,102,1,0,
- 0,114,195,0,0,0,114,16,0,0,0,114,69,1,0,0,
- 114,178,0,0,0,114,80,1,0,0,114,94,1,0,0,218,
- 9,109,101,116,97,95,112,97,116,104,114,197,0,0,0,114,
- 63,1,0,0,41,2,114,101,1,0,0,90,17,115,117,112,
- 112,111,114,116,101,100,95,108,111,97,100,101,114,115,114,7,
- 0,0,0,114,7,0,0,0,114,8,0,0,0,218,8,95,
- 105,110,115,116,97,108,108,70,6,0,0,115,10,0,0,0,
- 8,2,6,1,20,1,16,1,255,128,114,104,1,0,0,41,
- 1,114,75,0,0,0,41,1,78,41,3,78,78,78,41,2,
- 114,0,0,0,0,114,0,0,0,0,41,1,84,41,1,78,
- 41,1,78,41,83,114,139,0,0,0,114,146,0,0,0,114,
- 174,0,0,0,114,79,0,0,0,114,16,0,0,0,114,88,
- 0,0,0,114,171,0,0,0,114,26,0,0,0,114,218,0,
- 0,0,90,2,110,116,114,19,0,0,0,114,203,0,0,0,
- 90,5,112,111,115,105,120,114,48,0,0,0,218,3,97,108,
- 108,114,51,0,0,0,114,52,0,0,0,114,73,0,0,0,
- 114,29,0,0,0,90,37,95,67,65,83,69,95,73,78,83,
- 69,78,83,73,84,73,86,69,95,80,76,65,84,70,79,82,
- 77,83,95,66,89,84,69,83,95,75,69,89,114,28,0,0,
- 0,114,30,0,0,0,114,22,0,0,0,114,37,0,0,0,
- 114,43,0,0,0,114,46,0,0,0,114,54,0,0,0,114,
- 61,0,0,0,114,63,0,0,0,114,67,0,0,0,114,68,
- 0,0,0,114,71,0,0,0,114,74,0,0,0,114,84,0,
- 0,0,218,4,116,121,112,101,218,8,95,95,99,111,100,101,
- 95,95,114,173,0,0,0,114,35,0,0,0,114,159,0,0,
- 0,114,34,0,0,0,114,40,0,0,0,114,251,0,0,0,
- 114,104,0,0,0,114,100,0,0,0,114,113,0,0,0,114,
- 197,0,0,0,114,100,1,0,0,114,219,0,0,0,114,101,
- 0,0,0,90,23,68,69,66,85,71,95,66,89,84,69,67,
- 79,68,69,95,83,85,70,70,73,88,69,83,90,27,79,80,
- 84,73,77,73,90,69,68,95,66,89,84,69,67,79,68,69,
- 95,83,85,70,70,73,88,69,83,114,109,0,0,0,114,114,
- 0,0,0,114,120,0,0,0,114,124,0,0,0,114,126,0,
- 0,0,114,147,0,0,0,114,154,0,0,0,114,163,0,0,
- 0,114,167,0,0,0,114,169,0,0,0,114,176,0,0,0,
- 114,181,0,0,0,114,182,0,0,0,114,187,0,0,0,218,
- 6,111,98,106,101,99,116,114,196,0,0,0,114,201,0,0,
- 0,114,202,0,0,0,114,222,0,0,0,114,236,0,0,0,
- 114,254,0,0,0,114,21,1,0,0,114,27,1,0,0,114,
- 17,1,0,0,114,33,1,0,0,114,59,1,0,0,114,63,
- 1,0,0,114,80,1,0,0,114,99,1,0,0,114,195,0,
- 0,0,114,102,1,0,0,114,104,1,0,0,114,7,0,0,
+ 0,0,114,153,0,0,0,114,198,0,0,0,114,7,0,0,
+ 0,114,7,0,0,0,114,8,0,0,0,218,16,95,108,101,
+ 103,97,99,121,95,103,101,116,95,115,112,101,99,40,5,0,
+ 0,115,24,0,0,0,10,4,16,1,16,2,12,2,10,1,
+ 4,1,8,1,12,1,12,1,6,1,4,1,255,128,122,27,
+ 80,97,116,104,70,105,110,100,101,114,46,95,108,101,103,97,
+ 99,121,95,103,101,116,95,115,112,101,99,78,99,4,0,0,
+ 0,0,0,0,0,0,0,0,0,9,0,0,0,5,0,0,
+ 0,67,0,0,0,115,166,0,0,0,103,0,125,4,124,2,
+ 68,0,93,134,125,5,116,0,124,5,116,1,116,2,102,2,
+ 131,2,115,28,113,8,124,0,160,3,124,5,161,1,125,6,
+ 124,6,100,1,117,1,114,142,116,4,124,6,100,2,131,2,
+ 114,70,124,6,160,5,124,1,124,3,161,2,125,7,110,12,
+ 124,0,160,6,124,1,124,6,161,2,125,7,124,7,100,1,
+ 117,0,114,92,113,8,124,7,106,7,100,1,117,1,114,110,
+ 124,7,2,0,1,0,83,0,124,7,106,8,125,8,124,8,
+ 100,1,117,0,114,132,116,9,100,3,131,1,130,1,124,4,
+ 160,10,124,8,161,1,1,0,113,8,116,11,160,12,124,1,
+ 100,1,161,2,125,7,124,4,124,7,95,8,124,7,83,0,
+ 41,4,122,63,70,105,110,100,32,116,104,101,32,108,111,97,
+ 100,101,114,32,111,114,32,110,97,109,101,115,112,97,99,101,
+ 95,112,97,116,104,32,102,111,114,32,116,104,105,115,32,109,
+ 111,100,117,108,101,47,112,97,99,107,97,103,101,32,110,97,
+ 109,101,46,78,114,214,0,0,0,122,19,115,112,101,99,32,
+ 109,105,115,115,105,110,103,32,108,111,97,100,101,114,41,13,
+ 114,172,0,0,0,114,97,0,0,0,218,5,98,121,116,101,
+ 115,114,73,1,0,0,114,140,0,0,0,114,214,0,0,0,
+ 114,74,1,0,0,114,151,0,0,0,114,189,0,0,0,114,
+ 129,0,0,0,114,178,0,0,0,114,146,0,0,0,114,194,
+ 0,0,0,41,9,114,209,0,0,0,114,150,0,0,0,114,
+ 58,0,0,0,114,213,0,0,0,218,14,110,97,109,101,115,
+ 112,97,99,101,95,112,97,116,104,90,5,101,110,116,114,121,
+ 114,68,1,0,0,114,198,0,0,0,114,152,0,0,0,114,
+ 7,0,0,0,114,7,0,0,0,114,8,0,0,0,218,9,
+ 95,103,101,116,95,115,112,101,99,58,5,0,0,115,44,0,
+ 0,0,4,5,8,1,14,1,2,1,10,1,8,1,10,1,
+ 14,1,12,2,8,1,2,1,10,1,8,1,6,1,8,1,
+ 8,1,10,5,2,128,12,2,6,1,4,1,255,128,122,20,
+ 80,97,116,104,70,105,110,100,101,114,46,95,103,101,116,95,
+ 115,112,101,99,99,4,0,0,0,0,0,0,0,0,0,0,
+ 0,6,0,0,0,5,0,0,0,67,0,0,0,115,94,0,
+ 0,0,124,2,100,1,117,0,114,14,116,0,106,1,125,2,
+ 124,0,160,2,124,1,124,2,124,3,161,3,125,4,124,4,
+ 100,1,117,0,114,40,100,1,83,0,124,4,106,3,100,1,
+ 117,0,114,90,124,4,106,4,125,5,124,5,114,86,100,1,
+ 124,4,95,5,116,6,124,1,124,5,124,0,106,2,131,3,
+ 124,4,95,4,124,4,83,0,100,1,83,0,124,4,83,0,
+ 41,2,122,141,84,114,121,32,116,111,32,102,105,110,100,32,
+ 97,32,115,112,101,99,32,102,111,114,32,39,102,117,108,108,
+ 110,97,109,101,39,32,111,110,32,115,121,115,46,112,97,116,
+ 104,32,111,114,32,39,112,97,116,104,39,46,10,10,32,32,
+ 32,32,32,32,32,32,84,104,101,32,115,101,97,114,99,104,
+ 32,105,115,32,98,97,115,101,100,32,111,110,32,115,121,115,
+ 46,112,97,116,104,95,104,111,111,107,115,32,97,110,100,32,
+ 115,121,115,46,112,97,116,104,95,105,109,112,111,114,116,101,
+ 114,95,99,97,99,104,101,46,10,32,32,32,32,32,32,32,
+ 32,78,41,7,114,16,0,0,0,114,58,0,0,0,114,77,
+ 1,0,0,114,151,0,0,0,114,189,0,0,0,114,192,0,
+ 0,0,114,33,1,0,0,41,6,114,209,0,0,0,114,150,
+ 0,0,0,114,58,0,0,0,114,213,0,0,0,114,198,0,
+ 0,0,114,76,1,0,0,114,7,0,0,0,114,7,0,0,
+ 0,114,8,0,0,0,114,214,0,0,0,90,5,0,0,115,
+ 28,0,0,0,8,6,6,1,14,1,8,1,4,1,10,1,
+ 6,1,4,1,6,3,16,1,4,1,4,2,4,2,255,128,
+ 122,20,80,97,116,104,70,105,110,100,101,114,46,102,105,110,
+ 100,95,115,112,101,99,99,3,0,0,0,0,0,0,0,0,
+ 0,0,0,4,0,0,0,4,0,0,0,67,0,0,0,115,
+ 30,0,0,0,124,0,160,0,124,1,124,2,161,2,125,3,
+ 124,3,100,1,117,0,114,24,100,1,83,0,124,3,106,1,
+ 83,0,41,2,122,170,102,105,110,100,32,116,104,101,32,109,
+ 111,100,117,108,101,32,111,110,32,115,121,115,46,112,97,116,
+ 104,32,111,114,32,39,112,97,116,104,39,32,98,97,115,101,
+ 100,32,111,110,32,115,121,115,46,112,97,116,104,95,104,111,
+ 111,107,115,32,97,110,100,10,32,32,32,32,32,32,32,32,
+ 115,121,115,46,112,97,116,104,95,105,109,112,111,114,116,101,
+ 114,95,99,97,99,104,101,46,10,10,32,32,32,32,32,32,
+ 32,32,84,104,105,115,32,109,101,116,104,111,100,32,105,115,
+ 32,100,101,112,114,101,99,97,116,101,100,46,32,32,85,115,
+ 101,32,102,105,110,100,95,115,112,101,99,40,41,32,105,110,
+ 115,116,101,97,100,46,10,10,32,32,32,32,32,32,32,32,
+ 78,114,215,0,0,0,114,216,0,0,0,114,7,0,0,0,
+ 114,7,0,0,0,114,8,0,0,0,114,217,0,0,0,114,
+ 5,0,0,115,10,0,0,0,12,8,8,1,4,1,6,1,
+ 255,128,122,22,80,97,116,104,70,105,110,100,101,114,46,102,
+ 105,110,100,95,109,111,100,117,108,101,99,0,0,0,0,0,
+ 0,0,0,0,0,0,0,3,0,0,0,4,0,0,0,79,
+ 0,0,0,115,28,0,0,0,100,1,100,2,108,0,109,1,
+ 125,2,1,0,124,2,106,2,124,0,105,0,124,1,164,1,
+ 142,1,83,0,41,4,97,32,1,0,0,10,32,32,32,32,
+ 32,32,32,32,70,105,110,100,32,100,105,115,116,114,105,98,
+ 117,116,105,111,110,115,46,10,10,32,32,32,32,32,32,32,
+ 32,82,101,116,117,114,110,32,97,110,32,105,116,101,114,97,
+ 98,108,101,32,111,102,32,97,108,108,32,68,105,115,116,114,
+ 105,98,117,116,105,111,110,32,105,110,115,116,97,110,99,101,
+ 115,32,99,97,112,97,98,108,101,32,111,102,10,32,32,32,
+ 32,32,32,32,32,108,111,97,100,105,110,103,32,116,104,101,
+ 32,109,101,116,97,100,97,116,97,32,102,111,114,32,112,97,
+ 99,107,97,103,101,115,32,109,97,116,99,104,105,110,103,32,
+ 96,96,99,111,110,116,101,120,116,46,110,97,109,101,96,96,
+ 10,32,32,32,32,32,32,32,32,40,111,114,32,97,108,108,
+ 32,110,97,109,101,115,32,105,102,32,96,96,78,111,110,101,
+ 96,96,32,105,110,100,105,99,97,116,101,100,41,32,97,108,
+ 111,110,103,32,116,104,101,32,112,97,116,104,115,32,105,110,
+ 32,116,104,101,32,108,105,115,116,10,32,32,32,32,32,32,
+ 32,32,111,102,32,100,105,114,101,99,116,111,114,105,101,115,
+ 32,96,96,99,111,110,116,101,120,116,46,112,97,116,104,96,
+ 96,46,10,32,32,32,32,32,32,32,32,114,0,0,0,0,
+ 41,1,218,18,77,101,116,97,100,97,116,97,80,97,116,104,
+ 70,105,110,100,101,114,78,41,3,90,18,105,109,112,111,114,
+ 116,108,105,98,46,109,101,116,97,100,97,116,97,114,78,1,
+ 0,0,218,18,102,105,110,100,95,100,105,115,116,114,105,98,
+ 117,116,105,111,110,115,41,3,114,131,0,0,0,114,132,0,
+ 0,0,114,78,1,0,0,114,7,0,0,0,114,7,0,0,
+ 0,114,8,0,0,0,114,79,1,0,0,127,5,0,0,115,
+ 6,0,0,0,12,10,16,1,255,128,122,29,80,97,116,104,
+ 70,105,110,100,101,114,46,102,105,110,100,95,100,105,115,116,
+ 114,105,98,117,116,105,111,110,115,41,1,78,41,2,78,78,
+ 41,1,78,41,14,114,137,0,0,0,114,136,0,0,0,114,
+ 138,0,0,0,114,139,0,0,0,114,220,0,0,0,114,64,
+ 1,0,0,114,70,1,0,0,114,221,0,0,0,114,73,1,
+ 0,0,114,74,1,0,0,114,77,1,0,0,114,214,0,0,
+ 0,114,217,0,0,0,114,79,1,0,0,114,7,0,0,0,
+ 114,7,0,0,0,114,7,0,0,0,114,8,0,0,0,114,
+ 63,1,0,0,247,4,0,0,115,38,0,0,0,8,0,4,
+ 2,2,2,10,1,2,9,10,1,2,12,10,1,2,21,10,
+ 1,2,17,12,1,2,31,12,1,2,23,12,1,2,12,14,
+ 1,255,128,114,63,1,0,0,99,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,3,0,0,0,64,0,0,
+ 0,115,90,0,0,0,101,0,90,1,100,0,90,2,100,1,
+ 90,3,100,2,100,3,132,0,90,4,100,4,100,5,132,0,
+ 90,5,101,6,90,7,100,6,100,7,132,0,90,8,100,8,
+ 100,9,132,0,90,9,100,19,100,11,100,12,132,1,90,10,
+ 100,13,100,14,132,0,90,11,101,12,100,15,100,16,132,0,
+ 131,1,90,13,100,17,100,18,132,0,90,14,100,10,83,0,
+ 41,20,218,10,70,105,108,101,70,105,110,100,101,114,122,172,
+ 70,105,108,101,45,98,97,115,101,100,32,102,105,110,100,101,
+ 114,46,10,10,32,32,32,32,73,110,116,101,114,97,99,116,
+ 105,111,110,115,32,119,105,116,104,32,116,104,101,32,102,105,
+ 108,101,32,115,121,115,116,101,109,32,97,114,101,32,99,97,
+ 99,104,101,100,32,102,111,114,32,112,101,114,102,111,114,109,
+ 97,110,99,101,44,32,98,101,105,110,103,10,32,32,32,32,
+ 114,101,102,114,101,115,104,101,100,32,119,104,101,110,32,116,
+ 104,101,32,100,105,114,101,99,116,111,114,121,32,116,104,101,
+ 32,102,105,110,100,101,114,32,105,115,32,104,97,110,100,108,
+ 105,110,103,32,104,97,115,32,98,101,101,110,32,109,111,100,
+ 105,102,105,101,100,46,10,10,32,32,32,32,99,2,0,0,
+ 0,0,0,0,0,0,0,0,0,5,0,0,0,6,0,0,
+ 0,7,0,0,0,115,84,0,0,0,103,0,125,3,124,2,
+ 68,0,93,32,92,2,137,0,125,4,124,3,160,0,135,0,
+ 102,1,100,1,100,2,132,8,124,4,68,0,131,1,161,1,
+ 1,0,113,8,124,3,124,0,95,1,124,1,112,54,100,3,
+ 124,0,95,2,100,4,124,0,95,3,116,4,131,0,124,0,
+ 95,5,116,4,131,0,124,0,95,6,100,5,83,0,41,6,
+ 122,154,73,110,105,116,105,97,108,105,122,101,32,119,105,116,
+ 104,32,116,104,101,32,112,97,116,104,32,116,111,32,115,101,
+ 97,114,99,104,32,111,110,32,97,110,100,32,97,32,118,97,
+ 114,105,97,98,108,101,32,110,117,109,98,101,114,32,111,102,
+ 10,32,32,32,32,32,32,32,32,50,45,116,117,112,108,101,
+ 115,32,99,111,110,116,97,105,110,105,110,103,32,116,104,101,
+ 32,108,111,97,100,101,114,32,97,110,100,32,116,104,101,32,
+ 102,105,108,101,32,115,117,102,102,105,120,101,115,32,116,104,
+ 101,32,108,111,97,100,101,114,10,32,32,32,32,32,32,32,
+ 32,114,101,99,111,103,110,105,122,101,115,46,99,1,0,0,
+ 0,0,0,0,0,0,0,0,0,2,0,0,0,3,0,0,
+ 0,51,0,0,0,115,22,0,0,0,124,0,93,14,125,1,
+ 124,1,136,0,102,2,86,0,1,0,113,2,100,0,83,0,
+ 114,121,0,0,0,114,7,0,0,0,114,29,1,0,0,169,
+ 1,114,151,0,0,0,114,7,0,0,0,114,8,0,0,0,
+ 114,9,0,0,0,156,5,0,0,114,14,0,0,0,122,38,
+ 70,105,108,101,70,105,110,100,101,114,46,95,95,105,110,105,
+ 116,95,95,46,60,108,111,99,97,108,115,62,46,60,103,101,
+ 110,101,120,112,114,62,114,86,0,0,0,114,116,0,0,0,
+ 78,41,7,114,178,0,0,0,218,8,95,108,111,97,100,101,
+ 114,115,114,58,0,0,0,218,11,95,112,97,116,104,95,109,
+ 116,105,109,101,218,3,115,101,116,218,11,95,112,97,116,104,
+ 95,99,97,99,104,101,218,19,95,114,101,108,97,120,101,100,
+ 95,112,97,116,104,95,99,97,99,104,101,41,5,114,130,0,
+ 0,0,114,58,0,0,0,218,14,108,111,97,100,101,114,95,
+ 100,101,116,97,105,108,115,90,7,108,111,97,100,101,114,115,
+ 114,200,0,0,0,114,7,0,0,0,114,81,1,0,0,114,
+ 8,0,0,0,114,223,0,0,0,150,5,0,0,115,18,0,
+ 0,0,4,4,12,1,26,1,6,1,10,2,6,1,8,1,
+ 12,1,255,128,122,19,70,105,108,101,70,105,110,100,101,114,
+ 46,95,95,105,110,105,116,95,95,99,1,0,0,0,0,0,
+ 0,0,0,0,0,0,1,0,0,0,2,0,0,0,67,0,
+ 0,0,115,10,0,0,0,100,1,124,0,95,0,100,2,83,
+ 0,41,3,122,31,73,110,118,97,108,105,100,97,116,101,32,
+ 116,104,101,32,100,105,114,101,99,116,111,114,121,32,109,116,
+ 105,109,101,46,114,116,0,0,0,78,41,1,114,83,1,0,
+ 0,114,8,1,0,0,114,7,0,0,0,114,7,0,0,0,
+ 114,8,0,0,0,114,64,1,0,0,164,5,0,0,114,69,
+ 0,0,0,122,28,70,105,108,101,70,105,110,100,101,114,46,
+ 105,110,118,97,108,105,100,97,116,101,95,99,97,99,104,101,
+ 115,99,2,0,0,0,0,0,0,0,0,0,0,0,3,0,
+ 0,0,3,0,0,0,67,0,0,0,115,42,0,0,0,124,
+ 0,160,0,124,1,161,1,125,2,124,2,100,1,117,0,114,
+ 26,100,1,103,0,102,2,83,0,124,2,106,1,124,2,106,
+ 2,112,38,103,0,102,2,83,0,41,2,122,197,84,114,121,
+ 32,116,111,32,102,105,110,100,32,97,32,108,111,97,100,101,
+ 114,32,102,111,114,32,116,104,101,32,115,112,101,99,105,102,
+ 105,101,100,32,109,111,100,117,108,101,44,32,111,114,32,116,
+ 104,101,32,110,97,109,101,115,112,97,99,101,10,32,32,32,
+ 32,32,32,32,32,112,97,99,107,97,103,101,32,112,111,114,
+ 116,105,111,110,115,46,32,82,101,116,117,114,110,115,32,40,
+ 108,111,97,100,101,114,44,32,108,105,115,116,45,111,102,45,
+ 112,111,114,116,105,111,110,115,41,46,10,10,32,32,32,32,
+ 32,32,32,32,84,104,105,115,32,109,101,116,104,111,100,32,
+ 105,115,32,100,101,112,114,101,99,97,116,101,100,46,32,32,
+ 85,115,101,32,102,105,110,100,95,115,112,101,99,40,41,32,
+ 105,110,115,116,101,97,100,46,10,10,32,32,32,32,32,32,
+ 32,32,78,41,3,114,214,0,0,0,114,151,0,0,0,114,
+ 189,0,0,0,41,3,114,130,0,0,0,114,150,0,0,0,
+ 114,198,0,0,0,114,7,0,0,0,114,7,0,0,0,114,
+ 8,0,0,0,114,148,0,0,0,170,5,0,0,115,10,0,
+ 0,0,10,7,8,1,8,1,16,1,255,128,122,22,70,105,
+ 108,101,70,105,110,100,101,114,46,102,105,110,100,95,108,111,
+ 97,100,101,114,99,6,0,0,0,0,0,0,0,0,0,0,
+ 0,7,0,0,0,6,0,0,0,67,0,0,0,115,26,0,
+ 0,0,124,1,124,2,124,3,131,2,125,6,116,0,124,2,
+ 124,3,124,6,124,4,100,1,141,4,83,0,41,2,78,114,
+ 188,0,0,0,41,1,114,201,0,0,0,41,7,114,130,0,
+ 0,0,114,199,0,0,0,114,150,0,0,0,114,58,0,0,
+ 0,90,4,115,109,115,108,114,213,0,0,0,114,151,0,0,
0,114,7,0,0,0,114,7,0,0,0,114,8,0,0,0,
- 218,8,60,109,111,100,117,108,101,62,1,0,0,0,115,172,
- 0,0,0,4,0,4,22,8,3,8,1,8,1,8,1,8,
- 1,10,3,4,1,8,1,10,1,8,2,4,3,10,1,6,
- 2,22,2,8,1,10,1,14,1,4,4,4,1,2,1,2,
- 1,4,255,8,4,6,16,8,3,8,5,8,5,8,6,8,
- 6,8,12,8,10,8,9,8,5,8,7,10,9,10,22,0,
- 127,16,25,12,1,4,2,4,1,6,2,6,1,10,1,8,
- 2,6,2,8,2,16,2,8,71,8,40,8,19,8,12,8,
- 12,8,31,8,17,8,33,8,28,10,24,10,13,10,10,8,
- 11,6,14,4,3,2,1,12,255,14,68,14,64,16,30,0,
- 127,14,17,18,50,18,45,18,25,14,53,14,63,14,49,0,
- 127,14,20,0,127,10,22,8,23,8,11,12,5,255,128,
+ 114,77,1,0,0,182,5,0,0,115,10,0,0,0,10,1,
+ 8,1,2,1,6,255,255,128,122,20,70,105,108,101,70,105,
+ 110,100,101,114,46,95,103,101,116,95,115,112,101,99,78,99,
+ 3,0,0,0,0,0,0,0,0,0,0,0,14,0,0,0,
+ 8,0,0,0,67,0,0,0,115,100,1,0,0,100,1,125,
+ 3,124,1,160,0,100,2,161,1,100,3,25,0,125,4,122,
+ 24,116,1,124,0,106,2,112,34,116,3,160,4,161,0,131,
+ 1,106,5,125,5,87,0,110,20,4,0,116,6,144,1,121,
+ 98,1,0,1,0,1,0,100,4,125,5,89,0,124,5,124,
+ 0,106,7,107,3,114,88,124,0,160,8,161,0,1,0,124,
+ 5,124,0,95,7,116,9,131,0,114,110,124,0,106,10,125,
+ 6,124,4,160,11,161,0,125,7,110,10,124,0,106,12,125,
+ 6,124,4,125,7,124,7,124,6,118,0,114,214,116,13,124,
+ 0,106,2,124,4,131,2,125,8,124,0,106,14,68,0,93,
+ 58,92,2,125,9,125,10,100,5,124,9,23,0,125,11,116,
+ 13,124,8,124,11,131,2,125,12,116,15,124,12,131,1,114,
+ 204,124,0,160,16,124,10,124,1,124,12,124,8,103,1,124,
+ 2,161,5,2,0,1,0,83,0,113,146,116,17,124,8,131,
+ 1,125,3,124,0,106,14,68,0,93,86,92,2,125,9,125,
+ 10,116,13,124,0,106,2,124,4,124,9,23,0,131,2,125,
+ 12,116,18,106,19,100,6,124,12,100,3,100,7,141,3,1,
+ 0,124,7,124,9,23,0,124,6,118,0,144,1,114,50,116,
+ 15,124,12,131,1,144,1,114,50,124,0,160,16,124,10,124,
+ 1,124,12,100,8,124,2,161,5,2,0,1,0,83,0,113,
+ 220,124,3,144,1,114,94,116,18,160,19,100,9,124,8,161,
+ 2,1,0,116,18,160,20,124,1,100,8,161,2,125,13,124,
+ 8,103,1,124,13,95,21,124,13,83,0,100,8,83,0,119,
+ 0,41,10,122,111,84,114,121,32,116,111,32,102,105,110,100,
+ 32,97,32,115,112,101,99,32,102,111,114,32,116,104,101,32,
+ 115,112,101,99,105,102,105,101,100,32,109,111,100,117,108,101,
+ 46,10,10,32,32,32,32,32,32,32,32,82,101,116,117,114,
+ 110,115,32,116,104,101,32,109,97,116,99,104,105,110,103,32,
+ 115,112,101,99,44,32,111,114,32,78,111,110,101,32,105,102,
+ 32,110,111,116,32,102,111,117,110,100,46,10,32,32,32,32,
+ 32,32,32,32,70,114,86,0,0,0,114,45,0,0,0,114,
+ 116,0,0,0,114,223,0,0,0,122,9,116,114,121,105,110,
+ 103,32,123,125,41,1,90,9,118,101,114,98,111,115,105,116,
+ 121,78,122,25,112,111,115,115,105,98,108,101,32,110,97,109,
+ 101,115,112,97,99,101,32,102,111,114,32,123,125,41,22,114,
+ 55,0,0,0,114,63,0,0,0,114,58,0,0,0,114,19,
+ 0,0,0,114,70,0,0,0,114,22,1,0,0,114,64,0,
+ 0,0,114,83,1,0,0,218,11,95,102,105,108,108,95,99,
+ 97,99,104,101,114,22,0,0,0,114,86,1,0,0,114,117,
+ 0,0,0,114,85,1,0,0,114,54,0,0,0,114,82,1,
+ 0,0,114,68,0,0,0,114,77,1,0,0,114,71,0,0,
+ 0,114,146,0,0,0,114,160,0,0,0,114,194,0,0,0,
+ 114,189,0,0,0,41,14,114,130,0,0,0,114,150,0,0,
+ 0,114,213,0,0,0,90,12,105,115,95,110,97,109,101,115,
+ 112,97,99,101,90,11,116,97,105,108,95,109,111,100,117,108,
+ 101,114,180,0,0,0,90,5,99,97,99,104,101,90,12,99,
+ 97,99,104,101,95,109,111,100,117,108,101,90,9,98,97,115,
+ 101,95,112,97,116,104,114,30,1,0,0,114,199,0,0,0,
+ 90,13,105,110,105,116,95,102,105,108,101,110,97,109,101,90,
+ 9,102,117,108,108,95,112,97,116,104,114,198,0,0,0,114,
+ 7,0,0,0,114,7,0,0,0,114,8,0,0,0,114,214,
+ 0,0,0,187,5,0,0,115,80,0,0,0,4,5,14,1,
+ 2,1,24,1,14,1,6,1,10,1,8,1,6,1,6,2,
+ 6,1,10,1,6,2,4,1,8,2,12,1,14,1,8,1,
+ 10,1,8,1,24,1,2,255,8,5,14,2,16,1,16,1,
+ 14,1,10,1,10,1,4,1,8,255,2,128,6,2,12,1,
+ 12,1,8,1,4,1,4,1,2,219,255,128,122,20,70,105,
+ 108,101,70,105,110,100,101,114,46,102,105,110,100,95,115,112,
+ 101,99,99,1,0,0,0,0,0,0,0,0,0,0,0,9,
+ 0,0,0,10,0,0,0,67,0,0,0,115,190,0,0,0,
+ 124,0,106,0,125,1,122,22,116,1,160,2,124,1,112,22,
+ 116,1,160,3,161,0,161,1,125,2,87,0,110,24,4,0,
+ 116,4,116,5,116,6,102,3,121,188,1,0,1,0,1,0,
+ 103,0,125,2,89,0,116,7,106,8,160,9,100,1,161,1,
+ 115,78,116,10,124,2,131,1,124,0,95,11,110,74,116,10,
+ 131,0,125,3,124,2,68,0,93,56,125,4,124,4,160,12,
+ 100,2,161,1,92,3,125,5,125,6,125,7,124,6,114,130,
+ 100,3,160,13,124,5,124,7,160,14,161,0,161,2,125,8,
+ 110,4,124,5,125,8,124,3,160,15,124,8,161,1,1,0,
+ 113,88,124,3,124,0,95,11,116,7,106,8,160,9,116,16,
+ 161,1,114,184,100,4,100,5,132,0,124,2,68,0,131,1,
+ 124,0,95,17,100,6,83,0,100,6,83,0,119,0,41,7,
+ 122,68,70,105,108,108,32,116,104,101,32,99,97,99,104,101,
+ 32,111,102,32,112,111,116,101,110,116,105,97,108,32,109,111,
+ 100,117,108,101,115,32,97,110,100,32,112,97,99,107,97,103,
+ 101,115,32,102,111,114,32,116,104,105,115,32,100,105,114,101,
+ 99,116,111,114,121,46,114,15,0,0,0,114,86,0,0,0,
+ 114,76,0,0,0,99,1,0,0,0,0,0,0,0,0,0,
+ 0,0,2,0,0,0,4,0,0,0,83,0,0,0,115,20,
+ 0,0,0,104,0,124,0,93,12,125,1,124,1,160,0,161,
+ 0,146,2,113,4,83,0,114,7,0,0,0,41,1,114,117,
+ 0,0,0,41,2,114,5,0,0,0,90,2,102,110,114,7,
+ 0,0,0,114,7,0,0,0,114,8,0,0,0,114,13,0,
+ 0,0,8,6,0,0,115,4,0,0,0,20,0,255,128,122,
+ 41,70,105,108,101,70,105,110,100,101,114,46,95,102,105,108,
+ 108,95,99,97,99,104,101,46,60,108,111,99,97,108,115,62,
+ 46,60,115,101,116,99,111,109,112,62,78,41,18,114,58,0,
+ 0,0,114,19,0,0,0,90,7,108,105,115,116,100,105,114,
+ 114,70,0,0,0,114,71,1,0,0,218,15,80,101,114,109,
+ 105,115,115,105,111,110,69,114,114,111,114,218,18,78,111,116,
+ 65,68,105,114,101,99,116,111,114,121,69,114,114,111,114,114,
+ 16,0,0,0,114,26,0,0,0,114,27,0,0,0,114,84,
+ 1,0,0,114,85,1,0,0,114,112,0,0,0,114,77,0,
+ 0,0,114,117,0,0,0,218,3,97,100,100,114,28,0,0,
+ 0,114,86,1,0,0,41,9,114,130,0,0,0,114,58,0,
+ 0,0,90,8,99,111,110,116,101,110,116,115,90,21,108,111,
+ 119,101,114,95,115,117,102,102,105,120,95,99,111,110,116,101,
+ 110,116,115,114,56,1,0,0,114,128,0,0,0,114,40,1,
+ 0,0,114,30,1,0,0,90,8,110,101,119,95,110,97,109,
+ 101,114,7,0,0,0,114,7,0,0,0,114,8,0,0,0,
+ 114,88,1,0,0,235,5,0,0,115,40,0,0,0,6,2,
+ 2,1,22,1,18,1,6,3,12,3,12,1,6,7,8,1,
+ 16,1,4,1,18,1,4,2,12,1,6,1,12,1,20,1,
+ 4,255,2,233,255,128,122,22,70,105,108,101,70,105,110,100,
+ 101,114,46,95,102,105,108,108,95,99,97,99,104,101,99,1,
+ 0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,3,
+ 0,0,0,7,0,0,0,115,18,0,0,0,135,0,135,1,
+ 102,2,100,1,100,2,132,8,125,2,124,2,83,0,41,4,
+ 97,20,1,0,0,65,32,99,108,97,115,115,32,109,101,116,
+ 104,111,100,32,119,104,105,99,104,32,114,101,116,117,114,110,
+ 115,32,97,32,99,108,111,115,117,114,101,32,116,111,32,117,
+ 115,101,32,111,110,32,115,121,115,46,112,97,116,104,95,104,
+ 111,111,107,10,32,32,32,32,32,32,32,32,119,104,105,99,
+ 104,32,119,105,108,108,32,114,101,116,117,114,110,32,97,110,
+ 32,105,110,115,116,97,110,99,101,32,117,115,105,110,103,32,
+ 116,104,101,32,115,112,101,99,105,102,105,101,100,32,108,111,
+ 97,100,101,114,115,32,97,110,100,32,116,104,101,32,112,97,
+ 116,104,10,32,32,32,32,32,32,32,32,99,97,108,108,101,
+ 100,32,111,110,32,116,104,101,32,99,108,111,115,117,114,101,
+ 46,10,10,32,32,32,32,32,32,32,32,73,102,32,116,104,
+ 101,32,112,97,116,104,32,99,97,108,108,101,100,32,111,110,
+ 32,116,104,101,32,99,108,111,115,117,114,101,32,105,115,32,
+ 110,111,116,32,97,32,100,105,114,101,99,116,111,114,121,44,
+ 32,73,109,112,111,114,116,69,114,114,111,114,32,105,115,10,
+ 32,32,32,32,32,32,32,32,114,97,105,115,101,100,46,10,
+ 10,32,32,32,32,32,32,32,32,99,1,0,0,0,0,0,
+ 0,0,0,0,0,0,1,0,0,0,4,0,0,0,19,0,
+ 0,0,115,36,0,0,0,116,0,124,0,131,1,115,20,116,
+ 1,100,1,124,0,100,2,141,2,130,1,136,0,124,0,103,
+ 1,136,1,162,1,82,0,142,0,83,0,41,4,122,45,80,
+ 97,116,104,32,104,111,111,107,32,102,111,114,32,105,109,112,
+ 111,114,116,108,105,98,46,109,97,99,104,105,110,101,114,121,
+ 46,70,105,108,101,70,105,110,100,101,114,46,122,30,111,110,
+ 108,121,32,100,105,114,101,99,116,111,114,105,101,115,32,97,
+ 114,101,32,115,117,112,112,111,114,116,101,100,114,62,0,0,
+ 0,78,41,2,114,71,0,0,0,114,129,0,0,0,114,62,
+ 0,0,0,169,2,114,209,0,0,0,114,87,1,0,0,114,
+ 7,0,0,0,114,8,0,0,0,218,24,112,97,116,104,95,
+ 104,111,111,107,95,102,111,114,95,70,105,108,101,70,105,110,
+ 100,101,114,20,6,0,0,115,8,0,0,0,8,2,12,1,
+ 16,1,255,128,122,54,70,105,108,101,70,105,110,100,101,114,
+ 46,112,97,116,104,95,104,111,111,107,46,60,108,111,99,97,
+ 108,115,62,46,112,97,116,104,95,104,111,111,107,95,102,111,
+ 114,95,70,105,108,101,70,105,110,100,101,114,78,114,7,0,
+ 0,0,41,3,114,209,0,0,0,114,87,1,0,0,114,93,
+ 1,0,0,114,7,0,0,0,114,92,1,0,0,114,8,0,
+ 0,0,218,9,112,97,116,104,95,104,111,111,107,10,6,0,
+ 0,115,6,0,0,0,14,10,4,6,255,128,122,20,70,105,
+ 108,101,70,105,110,100,101,114,46,112,97,116,104,95,104,111,
+ 111,107,99,1,0,0,0,0,0,0,0,0,0,0,0,1,
+ 0,0,0,3,0,0,0,67,0,0,0,114,53,1,0,0,
+ 41,2,78,122,16,70,105,108,101,70,105,110,100,101,114,40,
+ 123,33,114,125,41,41,2,114,77,0,0,0,114,58,0,0,
+ 0,114,8,1,0,0,114,7,0,0,0,114,7,0,0,0,
+ 114,8,0,0,0,114,54,1,0,0,28,6,0,0,114,47,
+ 1,0,0,122,19,70,105,108,101,70,105,110,100,101,114,46,
+ 95,95,114,101,112,114,95,95,41,1,78,41,15,114,137,0,
+ 0,0,114,136,0,0,0,114,138,0,0,0,114,139,0,0,
+ 0,114,223,0,0,0,114,64,1,0,0,114,154,0,0,0,
+ 114,217,0,0,0,114,148,0,0,0,114,77,1,0,0,114,
+ 214,0,0,0,114,88,1,0,0,114,221,0,0,0,114,94,
+ 1,0,0,114,54,1,0,0,114,7,0,0,0,114,7,0,
+ 0,0,114,7,0,0,0,114,8,0,0,0,114,80,1,0,
+ 0,141,5,0,0,115,26,0,0,0,8,0,4,2,8,7,
+ 8,14,4,4,8,2,8,12,10,5,8,48,2,31,10,1,
+ 12,17,255,128,114,80,1,0,0,99,4,0,0,0,0,0,
+ 0,0,0,0,0,0,6,0,0,0,8,0,0,0,67,0,
+ 0,0,115,144,0,0,0,124,0,160,0,100,1,161,1,125,
+ 4,124,0,160,0,100,2,161,1,125,5,124,4,115,66,124,
+ 5,114,36,124,5,106,1,125,4,110,30,124,2,124,3,107,
+ 2,114,56,116,2,124,1,124,2,131,2,125,4,110,10,116,
+ 3,124,1,124,2,131,2,125,4,124,5,115,84,116,4,124,
+ 1,124,2,124,4,100,3,141,3,125,5,122,38,124,5,124,
+ 0,100,2,60,0,124,4,124,0,100,1,60,0,124,2,124,
+ 0,100,4,60,0,124,3,124,0,100,5,60,0,87,0,100,
+ 0,83,0,4,0,116,5,121,142,1,0,1,0,1,0,89,
+ 0,100,0,83,0,119,0,41,6,78,218,10,95,95,108,111,
+ 97,100,101,114,95,95,218,8,95,95,115,112,101,99,95,95,
+ 114,81,1,0,0,90,8,95,95,102,105,108,101,95,95,90,
+ 10,95,95,99,97,99,104,101,100,95,95,41,6,218,3,103,
+ 101,116,114,151,0,0,0,114,27,1,0,0,114,21,1,0,
+ 0,114,201,0,0,0,218,9,69,120,99,101,112,116,105,111,
+ 110,41,6,90,2,110,115,114,128,0,0,0,90,8,112,97,
+ 116,104,110,97,109,101,90,9,99,112,97,116,104,110,97,109,
+ 101,114,151,0,0,0,114,198,0,0,0,114,7,0,0,0,
+ 114,7,0,0,0,114,8,0,0,0,218,14,95,102,105,120,
+ 95,117,112,95,109,111,100,117,108,101,34,6,0,0,115,38,
+ 0,0,0,10,2,10,1,4,1,4,1,8,1,8,1,12,
+ 1,10,2,4,1,14,1,2,1,8,1,8,1,8,1,14,
+ 1,12,1,6,2,2,254,255,128,114,99,1,0,0,99,0,
+ 0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,3,
+ 0,0,0,67,0,0,0,115,38,0,0,0,116,0,116,1,
+ 160,2,161,0,102,2,125,0,116,3,116,4,102,2,125,1,
+ 116,5,116,6,102,2,125,2,124,0,124,1,124,2,103,3,
+ 83,0,41,2,122,95,82,101,116,117,114,110,115,32,97,32,
+ 108,105,115,116,32,111,102,32,102,105,108,101,45,98,97,115,
+ 101,100,32,109,111,100,117,108,101,32,108,111,97,100,101,114,
+ 115,46,10,10,32,32,32,32,69,97,99,104,32,105,116,101,
+ 109,32,105,115,32,97,32,116,117,112,108,101,32,40,108,111,
+ 97,100,101,114,44,32,115,117,102,102,105,120,101,115,41,46,
+ 10,32,32,32,32,78,41,7,114,17,1,0,0,114,174,0,
+ 0,0,218,18,101,120,116,101,110,115,105,111,110,95,115,117,
+ 102,102,105,120,101,115,114,21,1,0,0,114,113,0,0,0,
+ 114,27,1,0,0,114,101,0,0,0,41,3,90,10,101,120,
+ 116,101,110,115,105,111,110,115,90,6,115,111,117,114,99,101,
+ 90,8,98,121,116,101,99,111,100,101,114,7,0,0,0,114,
+ 7,0,0,0,114,8,0,0,0,114,195,0,0,0,57,6,
+ 0,0,115,10,0,0,0,12,5,8,1,8,1,10,1,255,
+ 128,114,195,0,0,0,99,1,0,0,0,0,0,0,0,0,
+ 0,0,0,1,0,0,0,1,0,0,0,67,0,0,0,115,
+ 8,0,0,0,124,0,97,0,100,0,83,0,114,121,0,0,
+ 0,41,1,114,146,0,0,0,41,1,218,17,95,98,111,111,
+ 116,115,116,114,97,112,95,109,111,100,117,108,101,114,7,0,
+ 0,0,114,7,0,0,0,114,8,0,0,0,218,21,95,115,
+ 101,116,95,98,111,111,116,115,116,114,97,112,95,109,111,100,
+ 117,108,101,68,6,0,0,115,4,0,0,0,8,2,255,128,
+ 114,102,1,0,0,99,1,0,0,0,0,0,0,0,0,0,
+ 0,0,2,0,0,0,4,0,0,0,67,0,0,0,115,50,
+ 0,0,0,116,0,124,0,131,1,1,0,116,1,131,0,125,
+ 1,116,2,106,3,160,4,116,5,106,6,124,1,142,0,103,
+ 1,161,1,1,0,116,2,106,7,160,8,116,9,161,1,1,
+ 0,100,1,83,0,41,2,122,41,73,110,115,116,97,108,108,
+ 32,116,104,101,32,112,97,116,104,45,98,97,115,101,100,32,
+ 105,109,112,111,114,116,32,99,111,109,112,111,110,101,110,116,
+ 115,46,78,41,10,114,102,1,0,0,114,195,0,0,0,114,
+ 16,0,0,0,114,69,1,0,0,114,178,0,0,0,114,80,
+ 1,0,0,114,94,1,0,0,218,9,109,101,116,97,95,112,
+ 97,116,104,114,197,0,0,0,114,63,1,0,0,41,2,114,
+ 101,1,0,0,90,17,115,117,112,112,111,114,116,101,100,95,
+ 108,111,97,100,101,114,115,114,7,0,0,0,114,7,0,0,
+ 0,114,8,0,0,0,218,8,95,105,110,115,116,97,108,108,
+ 73,6,0,0,115,10,0,0,0,8,2,6,1,20,1,16,
+ 1,255,128,114,104,1,0,0,41,1,114,75,0,0,0,41,
+ 1,78,41,3,78,78,78,41,2,114,0,0,0,0,114,0,
+ 0,0,0,41,1,84,41,1,78,41,1,78,41,83,114,139,
+ 0,0,0,114,146,0,0,0,114,174,0,0,0,114,79,0,
+ 0,0,114,16,0,0,0,114,88,0,0,0,114,171,0,0,
+ 0,114,26,0,0,0,114,218,0,0,0,90,2,110,116,114,
+ 19,0,0,0,114,203,0,0,0,90,5,112,111,115,105,120,
+ 114,48,0,0,0,218,3,97,108,108,114,51,0,0,0,114,
+ 52,0,0,0,114,73,0,0,0,114,29,0,0,0,90,37,
+ 95,67,65,83,69,95,73,78,83,69,78,83,73,84,73,86,
+ 69,95,80,76,65,84,70,79,82,77,83,95,66,89,84,69,
+ 83,95,75,69,89,114,28,0,0,0,114,30,0,0,0,114,
+ 22,0,0,0,114,37,0,0,0,114,43,0,0,0,114,46,
+ 0,0,0,114,54,0,0,0,114,61,0,0,0,114,63,0,
+ 0,0,114,67,0,0,0,114,68,0,0,0,114,71,0,0,
+ 0,114,74,0,0,0,114,84,0,0,0,218,4,116,121,112,
+ 101,218,8,95,95,99,111,100,101,95,95,114,173,0,0,0,
+ 114,35,0,0,0,114,159,0,0,0,114,34,0,0,0,114,
+ 40,0,0,0,114,251,0,0,0,114,104,0,0,0,114,100,
+ 0,0,0,114,113,0,0,0,114,197,0,0,0,114,100,1,
+ 0,0,114,219,0,0,0,114,101,0,0,0,90,23,68,69,
+ 66,85,71,95,66,89,84,69,67,79,68,69,95,83,85,70,
+ 70,73,88,69,83,90,27,79,80,84,73,77,73,90,69,68,
+ 95,66,89,84,69,67,79,68,69,95,83,85,70,70,73,88,
+ 69,83,114,109,0,0,0,114,114,0,0,0,114,120,0,0,
+ 0,114,124,0,0,0,114,126,0,0,0,114,147,0,0,0,
+ 114,154,0,0,0,114,163,0,0,0,114,167,0,0,0,114,
+ 169,0,0,0,114,176,0,0,0,114,181,0,0,0,114,182,
+ 0,0,0,114,187,0,0,0,218,6,111,98,106,101,99,116,
+ 114,196,0,0,0,114,201,0,0,0,114,202,0,0,0,114,
+ 222,0,0,0,114,236,0,0,0,114,254,0,0,0,114,21,
+ 1,0,0,114,27,1,0,0,114,17,1,0,0,114,33,1,
+ 0,0,114,59,1,0,0,114,63,1,0,0,114,80,1,0,
+ 0,114,99,1,0,0,114,195,0,0,0,114,102,1,0,0,
+ 114,104,1,0,0,114,7,0,0,0,114,7,0,0,0,114,
+ 7,0,0,0,114,8,0,0,0,218,8,60,109,111,100,117,
+ 108,101,62,1,0,0,0,115,172,0,0,0,4,0,4,22,
+ 8,3,8,1,8,1,8,1,8,1,10,3,4,1,8,1,
+ 10,1,8,2,4,3,10,1,6,2,22,2,8,1,10,1,
+ 14,1,4,4,4,1,2,1,2,1,4,255,8,4,6,16,
+ 8,3,8,5,8,5,8,6,8,6,8,12,8,10,8,9,
+ 8,5,8,7,10,9,10,22,0,127,16,25,12,1,4,2,
+ 4,1,6,2,6,1,10,1,8,2,6,2,8,2,16,2,
+ 8,71,8,40,8,19,8,12,8,12,8,31,8,17,8,33,
+ 8,28,10,24,10,13,10,10,8,11,6,14,4,3,2,1,
+ 12,255,14,68,14,64,16,30,0,127,14,17,18,50,18,45,
+ 18,25,14,53,14,63,14,49,0,127,14,23,0,127,10,22,
+ 8,23,8,11,12,5,255,128,
};
[View Less]
1
0

March 30, 2021
https://github.com/python/cpython/commit/9ac263091db4a8c7dedb577d01f544622a…
commit: 9ac263091db4a8c7dedb577d01f544622a448744
branch: 3.8
author: Christian Heimes <christian(a)python.org>
committer: miss-islington <31488909+miss-islington(a)users.noreply.github.com>
date: 2021-03-30T01:58:12-07:00
summary:
[3.8] bpo-43631: Update to OpenSSL 1.1.1k (GH-25024) (GH-25089)
Signed-off-by: Christian Heimes <christian(a)python.org>
Automerge-Triggered-By: GH:tiran.
(cherry …
[View More]picked from commit a54fc683f237d8f0b6e999a63aa9b8c0a45b7fef)
Co-authored-by: Christian Heimes <christian(a)python.org>
files:
A Misc/NEWS.d/next/Build/2021-03-26-09-16-34.bpo-43631.msJyPi.rst
M .azure-pipelines/ci.yml
M .azure-pipelines/pr.yml
M .github/workflows/build.yml
M .github/workflows/coverage.yml
M .travis.yml
M Mac/BuildScript/build-installer.py
M PCbuild/get_externals.bat
M PCbuild/python.props
M PCbuild/readme.txt
M Tools/ssl/multissltests.py
diff --git a/.azure-pipelines/ci.yml b/.azure-pipelines/ci.yml
index 3feb85ae6561d..0fe754bb071ea 100644
--- a/.azure-pipelines/ci.yml
+++ b/.azure-pipelines/ci.yml
@@ -57,7 +57,7 @@ jobs:
variables:
testRunTitle: '$(build.sourceBranchName)-linux'
testRunPlatform: linux
- openssl_version: 1.1.1g
+ openssl_version: 1.1.1k
steps:
- template: ./posix-steps.yml
@@ -83,7 +83,7 @@ jobs:
variables:
testRunTitle: '$(Build.SourceBranchName)-linux-coverage'
testRunPlatform: linux-coverage
- openssl_version: 1.1.1g
+ openssl_version: 1.1.1k
steps:
- template: ./posix-steps.yml
diff --git a/.azure-pipelines/pr.yml b/.azure-pipelines/pr.yml
index 2e94af35600cf..2d32e6d49bcc0 100644
--- a/.azure-pipelines/pr.yml
+++ b/.azure-pipelines/pr.yml
@@ -57,7 +57,7 @@ jobs:
variables:
testRunTitle: '$(system.pullRequest.TargetBranch)-linux'
testRunPlatform: linux
- openssl_version: 1.1.1g
+ openssl_version: 1.1.1k
steps:
- template: ./posix-steps.yml
@@ -83,7 +83,7 @@ jobs:
variables:
testRunTitle: '$(Build.SourceBranchName)-linux-coverage'
testRunPlatform: linux-coverage
- openssl_version: 1.1.1g
+ openssl_version: 1.1.1k
steps:
- template: ./posix-steps.yml
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 20d3040770f6d..cafe3d18bc3e7 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -118,7 +118,7 @@ jobs:
needs: check_source
if: needs.check_source.outputs.run_tests == 'true'
env:
- OPENSSL_VER: 1.1.1f
+ OPENSSL_VER: 1.1.1k
steps:
- uses: actions/checkout@v2
- name: Install Dependencies
diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml
index bfb077b299474..5ec2e526ab840 100644
--- a/.github/workflows/coverage.yml
+++ b/.github/workflows/coverage.yml
@@ -23,7 +23,7 @@ jobs:
name: 'Ubuntu (Coverage)'
runs-on: ubuntu-latest
env:
- OPENSSL_VER: 1.1.1f
+ OPENSSL_VER: 1.1.1k
steps:
- uses: actions/checkout@v2
- name: Install Dependencies
diff --git a/.travis.yml b/.travis.yml
index 39a3cf7e92964..f347b258d5088 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -10,7 +10,7 @@ cache:
env:
global:
- - OPENSSL=1.1.1f
+ - OPENSSL=1.1.1k
- OPENSSL_DIR="$HOME/multissl/openssl/${OPENSSL}"
- PATH="${OPENSSL_DIR}/bin:$PATH"
- CFLAGS="-I${OPENSSL_DIR}/include"
diff --git a/Mac/BuildScript/build-installer.py b/Mac/BuildScript/build-installer.py
index f2717b614a74a..a2d9a5e7454d5 100755
--- a/Mac/BuildScript/build-installer.py
+++ b/Mac/BuildScript/build-installer.py
@@ -209,9 +209,9 @@ def library_recipes():
result.extend([
dict(
- name="OpenSSL 1.1.1j",
- url="https://www.openssl.org/source/openssl-1.1.1j.tar.gz",
- checksum='cccaa064ed860a2b4d1303811bf5c682',
+ name="OpenSSL 1.1.1k",
+ url="https://www.openssl.org/source/openssl-1.1.1k.tar.gz",
+ checksum='c4e7d95f782b08116afa27b30393dd27',
buildrecipe=build_universal_openssl,
configure=None,
install=None,
diff --git a/Misc/NEWS.d/next/Build/2021-03-26-09-16-34.bpo-43631.msJyPi.rst b/Misc/NEWS.d/next/Build/2021-03-26-09-16-34.bpo-43631.msJyPi.rst
new file mode 100644
index 0000000000000..4de4905a6bb08
--- /dev/null
+++ b/Misc/NEWS.d/next/Build/2021-03-26-09-16-34.bpo-43631.msJyPi.rst
@@ -0,0 +1 @@
+Update macOS, Windows, and CI to OpenSSL 1.1.1k.
diff --git a/PCbuild/get_externals.bat b/PCbuild/get_externals.bat
index a1d9a12a362e1..9f27319918559 100644
--- a/PCbuild/get_externals.bat
+++ b/PCbuild/get_externals.bat
@@ -53,7 +53,7 @@ echo.Fetching external libraries...
set libraries=
set libraries=%libraries% bzip2-1.0.6
if NOT "%IncludeLibffiSrc%"=="false" set libraries=%libraries% libffi-3.3.0-rc0-r1
-if NOT "%IncludeSSLSrc%"=="false" set libraries=%libraries% openssl-1.1.1i
+if NOT "%IncludeSSLSrc%"=="false" set libraries=%libraries% openssl-1.1.1k
set libraries=%libraries% sqlite-3.34.0.0
if NOT "%IncludeTkinterSrc%"=="false" set libraries=%libraries% tcl-core-8.6.9.0
if NOT "%IncludeTkinterSrc%"=="false" set libraries=%libraries% tk-8.6.9.0
@@ -77,7 +77,7 @@ echo.Fetching external binaries...
set binaries=
if NOT "%IncludeLibffi%"=="false" set binaries=%binaries% libffi
-if NOT "%IncludeSSL%"=="false" set binaries=%binaries% openssl-bin-1.1.1i
+if NOT "%IncludeSSL%"=="false" set binaries=%binaries% openssl-bin-1.1.1k
if NOT "%IncludeTkinter%"=="false" set binaries=%binaries% tcltk-8.6.9.0
if NOT "%IncludeSSLSrc%"=="false" set binaries=%binaries% nasm-2.11.06
diff --git a/PCbuild/python.props b/PCbuild/python.props
index 3fa774816a753..5822ba13950f4 100644
--- a/PCbuild/python.props
+++ b/PCbuild/python.props
@@ -62,8 +62,8 @@
<libffiDir>$(ExternalsDir)libffi\</libffiDir>
<libffiOutDir>$(ExternalsDir)libffi\$(ArchName)\</libffiOutDir>
<libffiIncludeDir>$(libffiOutDir)include</libffiIncludeDir>
- <opensslDir>$(ExternalsDir)openssl-1.1.1i\</opensslDir>
- <opensslOutDir>$(ExternalsDir)openssl-bin-1.1.1i\$(ArchName)\</opensslOutDir>
+ <opensslDir>$(ExternalsDir)openssl-1.1.1k\</opensslDir>
+ <opensslOutDir>$(ExternalsDir)openssl-bin-1.1.1k\$(ArchName)\</opensslOutDir>
<opensslIncludeDir>$(opensslOutDir)include</opensslIncludeDir>
<nasmDir>$(ExternalsDir)\nasm-2.11.06\</nasmDir>
<zlibDir>$(ExternalsDir)\zlib-1.2.11\</zlibDir>
diff --git a/PCbuild/readme.txt b/PCbuild/readme.txt
index 0b2aa59ecefab..d2dbc50690db7 100644
--- a/PCbuild/readme.txt
+++ b/PCbuild/readme.txt
@@ -165,7 +165,7 @@ _lzma
Homepage:
http://tukaani.org/xz/
_ssl
- Python wrapper for version 1.1.1i of the OpenSSL secure sockets
+ Python wrapper for version 1.1.1k of the OpenSSL secure sockets
library, which is downloaded from our binaries repository at
https://github.com/python/cpython-bin-deps.
diff --git a/Tools/ssl/multissltests.py b/Tools/ssl/multissltests.py
index 3818165a836fb..0db1b35804d41 100755
--- a/Tools/ssl/multissltests.py
+++ b/Tools/ssl/multissltests.py
@@ -48,8 +48,8 @@
]
OPENSSL_RECENT_VERSIONS = [
- "1.1.1g",
- # "3.0.0-alpha2"
+ "1.1.1k",
+ # "3.0.0-alpha12"
]
LIBRESSL_OLD_VERSIONS = [
[View Less]
1
0

March 30, 2021
https://github.com/python/cpython/commit/cd82d592063aa03dcc238dcc5222bd47ee…
commit: cd82d592063aa03dcc238dcc5222bd47ee0eb438
branch: 3.9
author: Christian Heimes <christian(a)python.org>
committer: miss-islington <31488909+miss-islington(a)users.noreply.github.com>
date: 2021-03-30T01:58:06-07:00
summary:
[3.9] bpo-43631: Update to OpenSSL 1.1.1k (GH-25024) (GH-25088)
Signed-off-by: Christian Heimes <christian(a)python.org>
Automerge-Triggered-By: GH:tiran.
(cherry …
[View More]picked from commit a54fc683f237d8f0b6e999a63aa9b8c0a45b7fef)
Co-authored-by: Christian Heimes <christian(a)python.org>
files:
A Misc/NEWS.d/next/Build/2021-03-26-09-16-34.bpo-43631.msJyPi.rst
M .azure-pipelines/ci.yml
M .azure-pipelines/pr.yml
M .github/workflows/build.yml
M .github/workflows/coverage.yml
M .travis.yml
M Mac/BuildScript/build-installer.py
M PCbuild/get_externals.bat
M PCbuild/python.props
M PCbuild/readme.txt
M Tools/ssl/multissltests.py
diff --git a/.azure-pipelines/ci.yml b/.azure-pipelines/ci.yml
index 3feb85ae6561d..0fe754bb071ea 100644
--- a/.azure-pipelines/ci.yml
+++ b/.azure-pipelines/ci.yml
@@ -57,7 +57,7 @@ jobs:
variables:
testRunTitle: '$(build.sourceBranchName)-linux'
testRunPlatform: linux
- openssl_version: 1.1.1g
+ openssl_version: 1.1.1k
steps:
- template: ./posix-steps.yml
@@ -83,7 +83,7 @@ jobs:
variables:
testRunTitle: '$(Build.SourceBranchName)-linux-coverage'
testRunPlatform: linux-coverage
- openssl_version: 1.1.1g
+ openssl_version: 1.1.1k
steps:
- template: ./posix-steps.yml
diff --git a/.azure-pipelines/pr.yml b/.azure-pipelines/pr.yml
index 2e94af35600cf..2d32e6d49bcc0 100644
--- a/.azure-pipelines/pr.yml
+++ b/.azure-pipelines/pr.yml
@@ -57,7 +57,7 @@ jobs:
variables:
testRunTitle: '$(system.pullRequest.TargetBranch)-linux'
testRunPlatform: linux
- openssl_version: 1.1.1g
+ openssl_version: 1.1.1k
steps:
- template: ./posix-steps.yml
@@ -83,7 +83,7 @@ jobs:
variables:
testRunTitle: '$(Build.SourceBranchName)-linux-coverage'
testRunPlatform: linux-coverage
- openssl_version: 1.1.1g
+ openssl_version: 1.1.1k
steps:
- template: ./posix-steps.yml
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 9fa6033a9dc35..ce77250d7ff6d 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -125,7 +125,7 @@ jobs:
needs: check_source
if: needs.check_source.outputs.run_tests == 'true'
env:
- OPENSSL_VER: 1.1.1f
+ OPENSSL_VER: 1.1.1k
steps:
- uses: actions/checkout@v2
- name: Install Dependencies
diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml
index 6092f41325ff2..79c63e936f23f 100644
--- a/.github/workflows/coverage.yml
+++ b/.github/workflows/coverage.yml
@@ -25,7 +25,7 @@ jobs:
name: 'Ubuntu (Coverage)'
runs-on: ubuntu-latest
env:
- OPENSSL_VER: 1.1.1f
+ OPENSSL_VER: 1.1.1k
steps:
- uses: actions/checkout@v2
- name: Install Dependencies
diff --git a/.travis.yml b/.travis.yml
index 5d9f4208e0431..02b2afa4816c7 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -10,7 +10,7 @@ cache:
env:
global:
- - OPENSSL=1.1.1f
+ - OPENSSL=1.1.1k
- OPENSSL_DIR="$HOME/multissl/openssl/${OPENSSL}"
- PATH="${OPENSSL_DIR}/bin:$PATH"
- CFLAGS="-I${OPENSSL_DIR}/include"
diff --git a/Mac/BuildScript/build-installer.py b/Mac/BuildScript/build-installer.py
index 864661ec9e1b6..25a6a24f56494 100755
--- a/Mac/BuildScript/build-installer.py
+++ b/Mac/BuildScript/build-installer.py
@@ -242,9 +242,9 @@ def library_recipes():
result.extend([
dict(
- name="OpenSSL 1.1.1j",
- url="https://www.openssl.org/source/openssl-1.1.1j.tar.gz",
- checksum='cccaa064ed860a2b4d1303811bf5c682',
+ name="OpenSSL 1.1.1k",
+ url="https://www.openssl.org/source/openssl-1.1.1k.tar.gz",
+ checksum='c4e7d95f782b08116afa27b30393dd27',
buildrecipe=build_universal_openssl,
configure=None,
install=None,
diff --git a/Misc/NEWS.d/next/Build/2021-03-26-09-16-34.bpo-43631.msJyPi.rst b/Misc/NEWS.d/next/Build/2021-03-26-09-16-34.bpo-43631.msJyPi.rst
new file mode 100644
index 0000000000000..4de4905a6bb08
--- /dev/null
+++ b/Misc/NEWS.d/next/Build/2021-03-26-09-16-34.bpo-43631.msJyPi.rst
@@ -0,0 +1 @@
+Update macOS, Windows, and CI to OpenSSL 1.1.1k.
diff --git a/PCbuild/get_externals.bat b/PCbuild/get_externals.bat
index 1e783846a2b90..203290fbadbe7 100644
--- a/PCbuild/get_externals.bat
+++ b/PCbuild/get_externals.bat
@@ -53,7 +53,7 @@ echo.Fetching external libraries...
set libraries=
set libraries=%libraries% bzip2-1.0.6
if NOT "%IncludeLibffiSrc%"=="false" set libraries=%libraries% libffi
-if NOT "%IncludeSSLSrc%"=="false" set libraries=%libraries% openssl-1.1.1i
+if NOT "%IncludeSSLSrc%"=="false" set libraries=%libraries% openssl-1.1.1k
set libraries=%libraries% sqlite-3.34.0.0
if NOT "%IncludeTkinterSrc%"=="false" set libraries=%libraries% tcl-core-8.6.9.0
if NOT "%IncludeTkinterSrc%"=="false" set libraries=%libraries% tk-8.6.9.0
@@ -77,7 +77,7 @@ echo.Fetching external binaries...
set binaries=
if NOT "%IncludeLibffi%"=="false" set binaries=%binaries% libffi
-if NOT "%IncludeSSL%"=="false" set binaries=%binaries% openssl-bin-1.1.1i
+if NOT "%IncludeSSL%"=="false" set binaries=%binaries% openssl-bin-1.1.1k
if NOT "%IncludeTkinter%"=="false" set binaries=%binaries% tcltk-8.6.9.0
if NOT "%IncludeSSLSrc%"=="false" set binaries=%binaries% nasm-2.11.06
diff --git a/PCbuild/python.props b/PCbuild/python.props
index 3fa774816a753..5822ba13950f4 100644
--- a/PCbuild/python.props
+++ b/PCbuild/python.props
@@ -62,8 +62,8 @@
<libffiDir>$(ExternalsDir)libffi\</libffiDir>
<libffiOutDir>$(ExternalsDir)libffi\$(ArchName)\</libffiOutDir>
<libffiIncludeDir>$(libffiOutDir)include</libffiIncludeDir>
- <opensslDir>$(ExternalsDir)openssl-1.1.1i\</opensslDir>
- <opensslOutDir>$(ExternalsDir)openssl-bin-1.1.1i\$(ArchName)\</opensslOutDir>
+ <opensslDir>$(ExternalsDir)openssl-1.1.1k\</opensslDir>
+ <opensslOutDir>$(ExternalsDir)openssl-bin-1.1.1k\$(ArchName)\</opensslOutDir>
<opensslIncludeDir>$(opensslOutDir)include</opensslIncludeDir>
<nasmDir>$(ExternalsDir)\nasm-2.11.06\</nasmDir>
<zlibDir>$(ExternalsDir)\zlib-1.2.11\</zlibDir>
diff --git a/PCbuild/readme.txt b/PCbuild/readme.txt
index 5a21c30af9487..3acd99aa10793 100644
--- a/PCbuild/readme.txt
+++ b/PCbuild/readme.txt
@@ -166,7 +166,7 @@ _lzma
Homepage:
http://tukaani.org/xz/
_ssl
- Python wrapper for version 1.1.1i of the OpenSSL secure sockets
+ Python wrapper for version 1.1.1k of the OpenSSL secure sockets
library, which is downloaded from our binaries repository at
https://github.com/python/cpython-bin-deps.
diff --git a/Tools/ssl/multissltests.py b/Tools/ssl/multissltests.py
index 3818165a836fb..0db1b35804d41 100755
--- a/Tools/ssl/multissltests.py
+++ b/Tools/ssl/multissltests.py
@@ -48,8 +48,8 @@
]
OPENSSL_RECENT_VERSIONS = [
- "1.1.1g",
- # "3.0.0-alpha2"
+ "1.1.1k",
+ # "3.0.0-alpha12"
]
LIBRESSL_OLD_VERSIONS = [
[View Less]
1
0