Where/how to propose an addition to a standard module?

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.

it sounds like the said:
> make it sound as though these are meant for proposals for "Python
3000", which is not necessarily my intent.

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
 
A

Aaron \Castironpi\ Brady

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.

 From <http://www.python.org/dev/peps/pep-0001/>, it sounds like the  
PEP process is appropriate here, though other PEPs (like <http://www.python.org/dev/peps/pep-3001/
 > make it sound as though these are meant for proposals for "Python  
3000", which is not necessarily my intent.

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

I think it's something the 're' module already does. Correct me if
I'm wrong.
 
P

pruebauno

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.


3000", which is not necessarily my intent.

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

Whenever I needed such functionality I used the re module. The benefit
is that it uses unix style regular expression syntax and an egrep/awk/
perl/ruby user can understand it. You should show a few examples where
your proposal looks better than just using RE.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,756
Messages
2,569,533
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top