Testing if a global is defined in a module

Grant Edwards invalid at invalid.invalid
Thu Jul 7 10:18:32 EDT 2011


On 2011-07-06, Waldek M. <wm at localhost.localdomain> wrote:
> Dnia Wed, 06 Jul 2011 03:36:24 +1000, Steven D'Aprano napisa?(a):

>> Because unless you are extremely disciplined, code and the comments
>> describing them get out of sync. [...]

> True, but that gets far worse with external docs. Do you have in mind
> any better replacement?

You write code that's easy to read, and you provide the language with
introspection capabilities that allow you do do things like write a
program that will list the symbols exported by a module.

-- 
Grant Edwards               grant.b.edwards        Yow! Now that I have my
                                  at               "APPLE", I comprehend COST
                              gmail.com            ACCOUNTING!!



More information about the Python-list mailing list