> You might try: "These names don't just exist in some primordial soup. > There has to be a place they get stored. There is a bit of "magic": > import __main__ > a = 24 > print a, __main__.a > __main__.a = 365 > print a, __main__.a > > And even: > > print a, __main__.a, __main__.__main__.a >
After which I might go: >>> dir(__main__) ['__builtins__', '__doc__', '__main__', '__name__', 'a'] >>> dir(__builtins__) That'd connect back to Laura's focus on exception handling -- clearly the Error related content in __builtins__ is significant. >>> type(ArithmeticError) <type 'classobj'> >>> dir(ArithmeticError) ['__doc__', '__getitem__', '__init__', '__module__', '__str__'] >>> ArithmeticError.__module__ 'exceptions' >>> EnvironmentError.__module__ 'exceptions' >>> import exceptions >>> dir(exceptions) > Now everything is dot notation, with some of the "thing." stuff assumed. > Eventually you'll have to say locacal variables don't really work like > that, but they are close. > universe.milkyway.sun.earth.hawaii.maui is another way to introduce dot-notation. It's about progressively zooming in, or out, through a succession of progressively more, or less, encompassing domains. This gets us back to the root class/object metaphor, which allows us to appreciate the ordinary interaction of any two objects as involving encapsulation, polymorphism and message-passing i.e. the original SmallTalk paradigm. Kirby > > --Scott David Daniels > [EMAIL PROTECTED] > _______________________________________________ Edu-sig mailing list [email protected] http://mail.python.org/mailman/listinfo/edu-sig
