What's so funny? WAS Re: rotor replacement

phr at localhost.localdomain phr at localhost.localdomain
Mon Jan 24 17:33:20 EST 2005


"Fredrik Lundh" <fredrik at pythonware.com> writes:
> please answer the question: have you done this?  what kind of programs
> have you successfully delivered as "self-contained apps" for use on arbi-
> trary platforms?

Here's a simple one:

   import sha
   name = raw_input('Enter your name: ')
   print 'Your name hashes to:', sha.new(name).hexdigest()

Maybe the sha module isn't in fact available on all platforms, but
it's definitely available on more platforms than I personally have
compilers for.  Maybe some more complicated app will hit some
non-sha-related platform dependency and present a porting problem.
But it's worse if it has additional porting problems caused by the sha
module.  Making the sha module available on multiple platforms is a
good thing regardless of what the rest of the app does.  Doing that
means one less porting problem to worry about.  So your question is an
irrelevant misdirection.

Anyway, I've written Python code that that's run under Linux and
Windows and the Macintosh without needing porting.  That's not the
same as testing on every platform Python runs on, but if one of those
platforms fails other than from using a builtin module that's
documented as being platform specific, especially if the module is a
pure mathematically-defined algorithm like sha and not an OS-interfacing
module like threading or Tkinter, then I'd say the portability bug is
in Python or its library, not in my app.



More information about the Python-list mailing list