[Doc-SIG] looking for prior art

Guido van Rossum guido@python.org
Thu, 05 Dec 2002 04:02:09 -0500


> [David Goodger]
> 
> > So, is there any prior art out there?  Any pointers or advice?

[Brett Cannon]
> How does PyChecker do it?  I would guess by reading the bytecode, but you
> never know.

It reads the bytecode, but PyChecker 2.0 will read the source.  The
bytecode is often hard to use; it also changes between versions.

> I would guess using regexes would be the best if you just want to read the
> source.  The ``tokenize`` module has all the regexes and they might be
> available independently from the methods in the module.

I recommend using the tokenizer module directly.  See pyclbr.py (in
current CVS; it used to have its own set of regexps) for an example of
how to do this.

--Guido van Rossum (home page: http://www.python.org/~guido/)