python: cross-platform?

Steve Holden sholden at holdenweb.com
Tue May 7 17:45:40 EDT 2002


"Danyel Fisher" <danyelf at acm.org> wrote ...
> I was pleased to discover some time back that code written entirely on a
> UNIX machine worked with virtually [*] no changes on a PC. So--assuming
you
> aren't doing anything too exotic, you should find that most code you
> generate is largely cross-platform.
>
> [*] Ok, so the original coder had written something like
>     new Socket( host, port )
> it turns out that PC systems want the input to be a tuple,
>     new socket( (host, port) )
>

In truth, the difference was probably required by a move from 1.5.2 to some
higher version number.

Accepting two separate arguments rather than a (host, port) tuple was a bug
in earlier implementations of the socket library which was removed, IIRC, in
1.6 (to the sound of a certain amount of anguish from people who had relied
on the buggy behavior).

The form you used should, however, backport to 1.5.2 without error, I
believe. The socket library is pretty portable across platforms.

but-its-all-thanks-to-huge-numbers-of-#ifdefs-in-the-C-code-ly y'rs  - steve
--
Steve Holden: http://www.holdenweb.com/ ; Python Web Programming:
http://pydish.holdenweb.com/pwp/







More information about the Python-list mailing list