2007/10/31, Frank Aune <[EMAIL PROTECTED]>:
> Hello,
>
> Is it possible writing custom modules named the same as modules in the
> standard library, which in turn use the same module from the standard
> library?
>
> Say I want my application to have a random.py module, which in turn must
> import the standard library random.py module also, to get hold of the randint
> function for example.
>
> My attempts so far only causes my random.py to import itself instead of the
> standard library random.py
>
> Receipt for disaster? :)

You mean something like this:

>>>import random
>>>def foo():
...    print '42'
>>>random.randit = foo
>>>random.randit()
42

am I right?
--
Wbr, Andrii Mishkovskyi.

He's got a heart of a little child, and he keeps it in a jar on his desk.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to