Entry
Are circular package references allowed in Python?
Aug 9th, 2000 02:22
unknown unknown, Alex Martelli
They're allowed. E.g.:
D:\apy>python
Python 1.5.2 (#0, Apr 13 1999, 10:51:12) [MSC 32 bit (Intel)] on win32
Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
>>> import uno
>>> uno.fun()
Pak!
>>> import due
>>> due.fun()
Poook!
>>>
Where the packages are:
D:\apy>type uno.py
import due
pippo='Poook!'
def fun():
print due.pippo
D:\apy>type due.py
import uno
pippo='Pak!'
def fun():
print uno.pippo
D:\apy>