pygame and python 2.5

Steve Holden steve at holdenweb.com
Sun Feb 11 02:14:08 EST 2007


Ben Sizer wrote:
> On Feb 10, 8:42 am, Steve Holden <s... at holdenweb.com> wrote:
>> Hendrik van Rooyen wrote:
>>> <s... at pobox.com> wrote:
>>> "Ben Sizer" <kylo... at gmail.com> wrote:
>>>>     Ben> Python extensions written in C require recompilation for each new
>>>>     Ben> version of Python, due to Python limitations.
>>>> Can you propose a means to eliminate this limitation?
>>> Yes.   - Instead of calling something, send it a message...
>> I suppose you are proposing to use the ISO 19999.333 generic
>> message-passing interface for this? The one that doesn't actually call a
>> function to pass a message?
> 
> I'm assuming you're being facetious here..?
> 
You're right.

> Of course, functions get called at the ends of the message passing
> process, but those functions can stay the same across versions while
> the messages themselves change. The important part is reducing the
> binary interface between the two sides to a level where it's trivial
> to guarantee that part of the equation is safe.
> 
> eg.
> Instead of having PySomeType_FromLong(long value) exposed to the API,
> you could have a PyAnyObject_FromLong(long value, char*
> object_type_name). That function can return NULL and set up an
> exception if it doesn't understand the object you asked for, so Python
> versions earlier than the one that implement the type you want will
> just raise an exception gracefully rather than not linking.
> 
> The other issue comes with interfaces that are fragile by definition -
> eg. instead of returning a FILE* from Python to the extension,  return
> the file descriptor and create the FILE* on the extension side with
> fdopen.
> 
I agree that the coupling is rather tight at the moment and could do 
with being loosened to the degree you suggest.

My previous post was a knee-jerk reaction to the suggestion that 
substituting one mechanism for another equivalent one would, by itself, 
solve anything.

I am staying away from the Py3.0 discussions at the moment - does 
anybody know whether this problem is being addresses there?

regards
  Steve
-- 
Steve Holden       +44 150 684 7255  +1 800 494 3119
Holden Web LLC/Ltd          http://www.holdenweb.com
Skype: holdenweb     http://del.icio.us/steve.holden
Blog of Note:          http://holdenweb.blogspot.com
See you at PyCon?         http://us.pycon.org/TX2007




More information about the Python-list mailing list