writing my own extension

S

spohle

hi,

i use a lot the enumerate in my scripts and got really interested in
possibly writing my own enumerate as an extension, for which i would
want to extend it to be able to pass a start and step attribute.

can anyone point me on my way with good examples for that and how to
write extensions ?

thank you in advance
 
K

kyosohma

hi,

i use a lot the enumerate in my scripts and got really interested in
possibly writing my own enumerate as an extension, for which i would
want to extend it to be able to pass a start and step attribute.

can anyone point me on my way with good examples for that and how to
write extensions ?

thank you in advance

The range() builtin has this functionality. Also check out
http://docs.python.org/lib/itertools-functions.html

As for writing extensions, check out the following links:

http://docs.python.org/inst/tweak-flags.html
http://docs.python.org/dist/describing-extensions.html
http://www.geocities.com/foetsch/python/extending_python.htm
http://cxx.sourceforge.net/
http://www.vrplumber.com/programming/mstoolkit/

Interesting notes on iterators with (or without) a "step()":

http://mail.python.org/pipermail/python-bugs-list/2004-February/022007.html
http://www.thescripts.com/forum/thread556059.html
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/498272

Mike
 

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

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top