On 4/25/2012 1:18, Rotwang wrote: > Sorry if this is a stupid question, but what is up with this: > > >>> from calendar import* > >>> Calendar > > Traceback (most recent call last): > File "<pyshell#9>", line 1, in <module> > Calendar > NameError: name 'Calendar' is not defined > >>> from calendar import Calendar > >>> Calendar > <class 'calendar.Calendar'> > > ?
calendar.py defines __all__ this way: __all__ = ["IllegalMonthError", "IllegalWeekdayError", "setfirstweekday", "firstweekday", "isleap", "leapdays", "weekday", "monthrange", "monthcalendar", "prmonth", "month", "prcal", "calendar", "timegm", "month_name", "month_abbr", "day_name", "day_abbr"] Only those names are imported with '*'. Kiuhnm -- http://mail.python.org/mailman/listinfo/python-list