[Tutor] imported module/global

Kent Johnson kent37 at tds.net
Sun Apr 15 23:38:01 CEST 2007


Cecilia Alm wrote:
>> attributes of the module object. When you import the module in another
>> module, you gain access to the imported module's attributes using the
>> normal dot notation for attribute access.
> 
> By " attribute access", you also mean modifying/assigning to, right?

Yes, you can create and assign attributes in an imported module. In 
general I wouldn't recommend this, it could lead to code that is 
difficult to understand, but sometimes it is useful. For example you 
might have a shared configuration module, or a module might have 
configuration parameters that can be changed.

Kent


More information about the Tutor mailing list