Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #61411 > unrolled thread

Possible PEP Submission

Started byLogan Collins <logan.neal.collins@gmail.com>
First post2013-12-09 14:36 -0600
Last post2013-12-09 14:36 -0600
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python


Contents

  Possible PEP Submission Logan Collins <logan.neal.collins@gmail.com> - 2013-12-09 14:36 -0600

#61411 — Possible PEP Submission

FromLogan Collins <logan.neal.collins@gmail.com>
Date2013-12-09 14:36 -0600
SubjectPossible PEP Submission
Message-ID<mailman.3794.1386621408.18130.python-list@python.org>

[Multipart message — attachments visible in raw view] — view raw

Just checking whether 1) a PEP is the proper place for this and 2) what
y'all think about it.

I would like to propose a change to the the 're' standard library to
support iterables.

So, something like the following would work:

import re
text = """hello user
hello user
hello user"""

users = ["Bob", "Alice", "Jeffery"]

newtext = re.sub("user", users, text)

# newtext = "hello Bob\nhello Alice\nhello Jeffery"

There are a few corner cases I'm not sure what would be the best behavior.
Nor am I entirely certain this should be modified functionality or just...
a new function. What do y'all think?


-- 
---Logan Collins

GPG Public Key 2AAE8775
0xfc1185c82aae8775
http://keyserver.ubuntu.com:11371/pks/lookup?op=get&search=0xFC1185C82AAE8775

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web