A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2012-February/116699.html below:

[Python-Dev] cpython (2.7): use set

[Python-Dev] cpython (2.7): use set [Python-Dev] cpython (2.7): use setGeorg Brandl g.brandl at gmx.net
Tue Feb 21 08:06:29 CET 2012
Am 21.02.2012 05:13, schrieb benjamin.peterson:
> http://hg.python.org/cpython/rev/98732d20b6d1
> changeset:   75112:98732d20b6d1
> branch:      2.7
> user:        Benjamin Peterson <benjamin at python.org>
> date:        Mon Feb 20 23:11:19 2012 -0500
> summary:
>   use set
> 
> files:
>   Lib/re.py |  5 +----
>   1 files changed, 1 insertions(+), 4 deletions(-)
> 
> 
> diff --git a/Lib/re.py b/Lib/re.py
> --- a/Lib/re.py
> +++ b/Lib/re.py
> @@ -198,10 +198,7 @@
>      "Compile a template pattern, returning a pattern object"
>      return _compile(pattern, flags|T)
>  
> -_alphanum = {}
> -for c in 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890':
> -    _alphanum[c] = 1
> -del c
> +_alphanum = set('abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890')

Seems the "0" is twice in that set. ;-)

Georg

More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4