473,382 Members | 1,647 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

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

Oct 10 '08 #1
2 908
On Oct 10, 2:10*pm, Joe Strout <j...@strout.netwrote:
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.
Oct 11 '08 #2
On Oct 10, 3:10 pm, Joe Strout <j...@strout.netwrote:
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
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.
Oct 13 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

37
by: michele.simionato | last post by:
Paul Rubin wrote: > How about macros? Some pretty horrible things have been done in C > programs with the C preprocessor. But there's a movememnt afloat to > add hygienic macros to Python. Got any...
2
by: F. Petitjean | last post by:
I have written a script to find the modules which export the largest number of names. The gc.getreferrers(*objs) function gives also an idea of the dependencies between the modules. The code...
6
by: bobueland | last post by:
The module string has a function called translate. I tried to find the source code for that function. In: C:\Python24\Lib there is one file called string.py I open it and it says
11
by: fortepianissimo | last post by:
Say I have the following package organization in a system I'm developing: A |----B |----C |----D I have a module, say 'foo', that both package D and B require. What is the best practice in...
41
by: Miroslaw Makowiecki | last post by:
Where can I download Comeau compiler as a trial version? Thanks in advice.
5
by: PaulS | last post by:
new to Fedora7, typed python in interactive interpreter, then help(). Then modules to get a list of modules. Then module name to get info on a module but no help file. What is the help file...
6
by: pythonnubie | last post by:
Hi All : Does anyone know where I can find either a book or a website that explains beginning python by actually building a project line by line and explaining it indepth . I am...
0
by: Skip Montanaro | last post by:
I would like to propose a new method for the string.Template class. What's There is a python-ideas mailing list. I think that's probably the right place to start. If it gets a generally...
3
by: Philip Semanchuk | last post by:
On Nov 9, 2008, at 7:00 PM, News123 wrote: Look under the heading "Standard Encodings": http://docs.python.org/library/codecs.html Note that both the page you found (which appears to be a...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.