<feed xmlns='http://www.w3.org/2005/Atom'>
<title>python.git/Lib/re.py, branch 3.10</title>
<subtitle>Python interpreter</subtitle>
<id>http://dangofactory.net/cgit/cgit.cgi/Server/python.git/atom/Lib/re.py?h=3.10</id>
<link rel='self' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/atom/Lib/re.py?h=3.10'/>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/'/>
<updated>2021-07-04T04:08:42Z</updated>
<entry>
<title>[3.10] bpo-44559: [Enum] revert enum module to 3.9 (GH-27010)</title>
<updated>2021-07-04T04:08:42Z</updated>
<author>
<name>Ethan Furman</name>
<email>ethan@stoneleaf.us</email>
</author>
<published>2021-07-04T04:08:42Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=9bf7c2d638a582af2444bc864feba13ab8957b68'/>
<id>urn:sha1:9bf7c2d638a582af2444bc864feba13ab8957b68</id>
<content type='text'>
* [Enum] revert enum module to 3.9</content>
</entry>
<entry>
<title>bpo-38659: [Enum] add _simple_enum decorator (GH-25497)</title>
<updated>2021-04-21T17:20:44Z</updated>
<author>
<name>Ethan Furman</name>
<email>ethan@stoneleaf.us</email>
</author>
<published>2021-04-21T17:20:44Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=a02cb474f9c097c83cd444a47e9fb5f99b4aaf45'/>
<id>urn:sha1:a02cb474f9c097c83cd444a47e9fb5f99b4aaf45</id>
<content type='text'>
add:

* `_simple_enum` decorator to transform a normal class into an enum
* `_test_simple_enum` function to compare
* `_old_convert_` to enable checking `_convert_` generated enums

`_simple_enum` takes a normal class and converts it into an enum:

    @simple_enum(Enum)
    class Color:
        RED = 1
        GREEN = 2
        BLUE = 3

`_old_convert_` works much like` _convert_` does, using the original logic:

    # in a test file
    import socket, enum
    CheckedAddressFamily = enum._old_convert_(
            enum.IntEnum, 'AddressFamily', 'socket',
            lambda C: C.isupper() and C.startswith('AF_'),
            source=_socket,
            )

`_test_simple_enum` takes a traditional enum and a simple enum and
compares the two:

    # in the REPL or the same module as Color
    class CheckedColor(Enum):
        RED = 1
        GREEN = 2
        BLUE = 3

    _test_simple_enum(CheckedColor, Color)

    _test_simple_enum(CheckedAddressFamily, socket.AddressFamily)

Any important differences will raise a TypeError</content>
</entry>
<entry>
<title>Revert "bpo-38659: [Enum] add _simple_enum decorator (GH-25285)" (GH-25476)</title>
<updated>2021-04-20T02:12:24Z</updated>
<author>
<name>Ethan Furman</name>
<email>ethan@stoneleaf.us</email>
</author>
<published>2021-04-20T02:12:24Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=503cdc7c124cebbd777008bdf7bd9aa666b25f07'/>
<id>urn:sha1:503cdc7c124cebbd777008bdf7bd9aa666b25f07</id>
<content type='text'>
This reverts commit dbac8f40e81eb0a29dc833e6409a1abf47467da6.</content>
</entry>
<entry>
<title>bpo-38659: [Enum] add _simple_enum decorator (GH-25285)</title>
<updated>2021-04-20T01:04:53Z</updated>
<author>
<name>Ethan Furman</name>
<email>ethan@stoneleaf.us</email>
</author>
<published>2021-04-20T01:04:53Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=dbac8f40e81eb0a29dc833e6409a1abf47467da6'/>
<id>urn:sha1:dbac8f40e81eb0a29dc833e6409a1abf47467da6</id>
<content type='text'>
add:

_simple_enum decorator to transform a normal class into an enum
_test_simple_enum function to compare
_old_convert_ to enable checking _convert_ generated enums
_simple_enum takes a normal class and converts it into an enum:

@simple_enum(Enum)
class Color:
    RED = 1
    GREEN = 2
    BLUE = 3

_old_convert_ works much like _convert_ does, using the original logic:

# in a test file
import socket, enum
CheckedAddressFamily = enum._old_convert_(
        enum.IntEnum, 'AddressFamily', 'socket',
        lambda C: C.isupper() and C.startswith('AF_'),
        source=_socket,
        )

test_simple_enum takes a traditional enum and a simple enum and
compares the two:

# in the REPL or the same module as Color
class CheckedColor(Enum):
    RED = 1
    GREEN = 2
    BLUE = 3

_test_simple_enum(CheckedColor, Color)

_test_simple_enum(CheckedAddressFamily, socket.AddressFamily)

Any important differences will raise a TypeError</content>
</entry>
<entry>
<title>bpo-40066: Enum: modify `repr()` and `str()` (GH-22392)</title>
<updated>2021-03-31T04:17:26Z</updated>
<author>
<name>Ethan Furman</name>
<email>ethan@stoneleaf.us</email>
</author>
<published>2021-03-31T04:17:26Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=b775106d940e3d77c8af7967545bb9a5b7b162df'/>
<id>urn:sha1:b775106d940e3d77c8af7967545bb9a5b7b162df</id>
<content type='text'>
* Enum: streamline repr() and str(); improve docs

- repr() is now ``enum_class.member_name``
- stdlib global enums are ``module_name.member_name``
- str() is now ``member_name``
- add HOW-TO section for ``Enum``
- change main documentation to be an API reference</content>
</entry>
<entry>
<title>bpo-38250: [Enum] single-bit flags are canonical (GH-24215)</title>
<updated>2021-01-25T22:26:19Z</updated>
<author>
<name>Ethan Furman</name>
<email>ethan@stoneleaf.us</email>
</author>
<published>2021-01-25T22:26:19Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=7aaeb2a3d682ecba125c33511e4b4796021d2f82'/>
<id>urn:sha1:7aaeb2a3d682ecba125c33511e4b4796021d2f82</id>
<content type='text'>
Flag members are now divided by one-bit verses multi-bit, with multi-bit being treated as aliases. Iterating over a flag only returns the contained single-bit flags.

Iterating, repr(), and str() show members in definition order.

When constructing combined-member flags, any extra integer values are either discarded (CONFORM), turned into ints (EJECT) or treated as errors (STRICT). Flag classes can specify which of those three behaviors is desired:

&gt;&gt;&gt; class Test(Flag, boundary=CONFORM):
...     ONE = 1
...     TWO = 2
...
&gt;&gt;&gt; Test(5)
&lt;Test.ONE: 1&gt;

Besides the three above behaviors, there is also KEEP, which should not be used unless necessary -- for example, _convert_ specifies KEEP as there are flag sets in the stdlib that are incomplete and/or inconsistent (e.g. ssl.Options). KEEP will, as the name suggests, keep all bits; however, iterating over a flag with extra bits will only return the canonical flags contained, not the extra bits.

Iteration is now in member definition order.  If member definition order
matches increasing value order, then a more efficient method of flag
decomposition is used; otherwise, sort() is called on the results of
that method to get definition order.


``re`` module:

repr() has been modified to support as closely as possible its previous
output; the big difference is that inverted flags cannot be output as
before because the inversion operation now always returns the comparable
positive result; i.e.

   re.A|re.I|re.M|re.S is ~(re.L|re.U|re.S|re.T|re.DEBUG)

in both of the above terms, the ``value`` is 282.

re's tests have been updated to reflect the modifications to repr().
</content>
</entry>
<entry>
<title>bpo-40016: re docstring: Clarify relationship of inline and argument flags (#19078)</title>
<updated>2020-03-25T18:44:47Z</updated>
<author>
<name>Ram Rachum</name>
<email>ram@rachum.com</email>
</author>
<published>2020-03-25T18:44:47Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=89a2209ae6fc5f39868621799730e16f931eb497'/>
<id>urn:sha1:89a2209ae6fc5f39868621799730e16f931eb497</id>
<content type='text'>


Co-authored-by: Terry Jan Reedy &lt;tjreedy@udel.edu&gt;</content>
</entry>
<entry>
<title>bpo-36548: Improve the repr of re flags. (GH-12715)</title>
<updated>2019-05-31T07:39:47Z</updated>
<author>
<name>Serhiy Storchaka</name>
<email>storchaka@gmail.com</email>
</author>
<published>2019-05-31T07:39:47Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=14a0e16c8805f7ba7c98132ead815dcfdf0e9d33'/>
<id>urn:sha1:14a0e16c8805f7ba7c98132ead815dcfdf0e9d33</id>
<content type='text'>
</content>
</entry>
<entry>
<title>bpo-34681: Rename class Pattern in sre_parse to State. (GH-9310)</title>
<updated>2018-09-18T06:16:26Z</updated>
<author>
<name>Serhiy Storchaka</name>
<email>storchaka@gmail.com</email>
</author>
<published>2018-09-18T06:16:26Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=e0c19ddc661e56cc7e694be52d3e47f1dfe5af24'/>
<id>urn:sha1:e0c19ddc661e56cc7e694be52d3e47f1dfe5af24</id>
<content type='text'>
Also rename corresponding attributes, parameters and variables.</content>
</entry>
<entry>
<title>bpo-32338: OrderedDict import is no longer needed in re. (#4891)</title>
<updated>2018-03-11T06:38:13Z</updated>
<author>
<name>Serhiy Storchaka</name>
<email>storchaka@gmail.com</email>
</author>
<published>2018-03-11T06:38:13Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=b931bd0a2fe7e9293339019352baf3317166b769'/>
<id>urn:sha1:b931bd0a2fe7e9293339019352baf3317166b769</id>
<content type='text'>
</content>
</entry>
</feed>
