J
Joe Strout
I would like to propose a new method for the string.Template class.
What's the proper procedure for doing this? I've joined the python-
ideas list, but that seems to be only for proposed language changes,
and my idea doesn't require any change to the language at all.
Here's a brief sketch of my proposal, in case it helps:
Add a "match" function to string.Template, which takes a text string
as a parameter. If this text string can be matched to the template,
by substituting some portion of the given string for each field of the
template, then .match returns a dictionary, where each key is a field
name and the value is the corresponding text from the input. If the
text string cannot be matched to the template, then .match returns None.
I understand that if I'm to write a PEP, I'll need to flesh this out
considerably as per PEP 0001. But that document also suggests first
discussing it here. I'm still a newbie (or actually, oldbie-turned-
nonbie-turned-newbie-again), so I could use some advice. What's the
next step in advocating for this idea?
Thanks,
- Joe
What's the proper procedure for doing this? I've joined the python-
ideas list, but that seems to be only for proposed language changes,
and my idea doesn't require any change to the language at all.
3000", which is not necessarily my intent.it sounds like the said:> make it sound as though these are meant for proposals for "Python
Here's a brief sketch of my proposal, in case it helps:
Add a "match" function to string.Template, which takes a text string
as a parameter. If this text string can be matched to the template,
by substituting some portion of the given string for each field of the
template, then .match returns a dictionary, where each key is a field
name and the value is the corresponding text from the input. If the
text string cannot be matched to the template, then .match returns None.
I understand that if I'm to write a PEP, I'll need to flesh this out
considerably as per PEP 0001. But that document also suggests first
discussing it here. I'm still a newbie (or actually, oldbie-turned-
nonbie-turned-newbie-again), so I could use some advice. What's the
next step in advocating for this idea?
Thanks,
- Joe