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/2004-September/048807.html below:

[Python-Dev] Re: Re: Alternative ImplementationforPEP292:SimpleStringSubstitutions

[Python-Dev] Re: Re: Alternative ImplementationforPEP292:SimpleStringSubstitutions [Python-Dev] Re: Re: Alternative ImplementationforPEP292:SimpleStringSubstitutionsFredrik Lundh fredrik at pythonware.com
Sat Sep 11 08:52:06 CEST 2004
Raymond Hettinger wrote:

> """Placeholders must be a valid Python identifier (containing only ASCII
> alphanumeric characters and an underscore).  If an unbraced identifier
> ends with a non-ASCII alphanumeric character, such as the latin letter n
> with tilde in $maƱana, then a ValueError is raised for the specious
> identifier.

so why keep the python identifier limitation?  the RE engine you're using to
parse the template has a concept of "alphanumeric character".  just define
the placeholder syntax as "one or more alphanumeric characters or under-
scores" (\w+), use re.UNICODE if the template is created from a unicode
string, and you're done.

this doesn't mean that people *have* to use non-ASCII characters, of course.
but if they do, things just work.

</F> 



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