Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old October 10th, 2008, 08:15 PM
Joe Strout
Guest
 
Posts: n/a
Default Where/how to propose an addition to a standard module?

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/
Quote:
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



  #2  
Old October 11th, 2008, 01:45 AM
Aaron \Castironpi\ Brady
Guest
 
Posts: n/a
Default Re: Where/how to propose an addition to a standard module?

On Oct 10, 2:10*pm, Joe Strout <j...@strout.netwrote:
Quote:
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.
  #3  
Old October 13th, 2008, 03:55 PM
pruebauno@latinmail.com
Guest
 
Posts: n/a
Default Re: Where/how to propose an addition to a standard module?

On Oct 10, 3:10 pm, Joe Strout <j...@strout.netwrote:
Quote:
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/
Quote:
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
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.
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles