Shed Skin - Does it break any Python assumptions?

skip at pobox.com skip at pobox.com
Mon Dec 18 09:07:59 EST 2006


I just noticed the announcement of Shed Skin 0.0.16 on Freshmeat with this
(partial) change announcement:

    Changes: frozenset was added. time.sleep now works on Win32.

Given Python's highly dynamic nature it's unclear to me how Shed Skin could
know enough about the semantics of time.sleep to know whether or not it's
broken on Win32.  This suggests that to gain speedups it probably implements
a more static language than Python.  For example, does Shed Skin handle a
case like this?

    >>> import time
    >>> time.sleep(1)
    >>> def _sleep(n):
    ...   print "sleeping for", n, "seconds"
    ...   time._sleep(n)
    ...
    >>> time._sleep = time.sleep
    >>> time.sleep = _sleep
    >>> time.sleep(1)
    sleeping for 1 seconds

What does this phrase in the announcement mean?  "... pure but implicitly
statically typed Python ...".  Where does the static typing begin and end?
Can one module tweak another module's attributes?  Can a class's attributes
be modified from outside the class?  What about the attributes of a class
instance?

Skip



More information about the Python-list mailing list