tp_members and T_ULONGLONG ("C" Python modules)

Gimble marleyziggy at hotmail.com
Fri Sep 1 18:49:31 EDT 2006


While writing custom modules, I've found the tp_members type entry very
useful.  (As background, it is a pointer to a constant structure that
defines direct access sizes and types of member variables within your
custom PyObject ).

However, the defined type enumeration (including T_USHORT, T_UINT,
etc.) does not have a conversion type for a 64-bit signed or unsigned
type.  Additional defines for T_LONGLONG and T_ULONGLONG seemed
appropriate.

So, with a minimum of digging, I added an appropriate set of #defines
to structmember.h and conversion code to PyMember_SetOne() and
PyMember_GetOne(), and the definitions magically now work in my module.
 Consider me happy...

...until I start weeding through the "Intro to Development" document
(and associated links) at python.org.  After all, I'd like to donate my
changes to Python so that others can benefit from my own development.

Now I'm confused.  A PEP seems a bit... extravagant for such a
relatively small change to two source files, probably 30-50 lines in
total.  And yet, I'm not sure I should just enter a patch entry on
SourceForge, since it's not really a bug (it's a new feature), but it's
hardly anything like a significant enhancement.

So, can someone offer advice on the best way for me to proceed?  I'd
like to figure out the "right way" to submit the changes for approval
into the next release of Python, as I figure that 64-bit support is
something people will find more and more useful going forward.  Oddly
enough, ParseTuple() already handles 64-bit values, so I'm apparently
not alone in that opinion. :)

Help!




More information about the Python-list mailing list