summaryrefslogtreecommitdiffstats
path: root/Lib/pyclbr.py
Commit message (Collapse)AuthorAgeFilesLines
* Minor cleanups:Skip Montanaro2008-04-281-35/+37
| | | | | | | | * Avoid creating unused local variables where we can. Where we can't prefix the unused variables with '_'. * Avoid shadowing builtins where it won't change the external interface of a function. * Use None as default path arg to readmodule and readmodule_ex.
* Bug #1560617: in pyclbr, return full module name not only for classes,Georg Brandl2006-09-301-1/+1
| | | | but also for functions.
* Fix #1494787 (pyclbr counts whitespace as superclass name)Georg Brandl2006-05-291-2/+4
|
* PEP-0318, @decorator-style. In Guido's words:Anthony Baxter2004-08-021-1/+1
| | | | | "@ seems the syntax that everybody can hate equally" Implementation by Mark Russell, from SF #979728.
* Guido grants a Christmas wish:Raymond Hettinger2003-12-171-1/+1
| | | | sorted() becomes a regular function instead of a classmethod.
* Apply extract functions instead of lambda.Raymond Hettinger2003-12-011-2/+2
|
* Another big update, fixing all known bugs related to nesting functionsGuido van Rossum2002-12-031-50/+80
| | | | | and classes. Also add a mini main program that dumps the results for a given file or module.
* Moderately heavy reorganization of pyclbr to fix package-related bugs.Guido van Rossum2002-12-021-53/+65
| | | | | | | | | | | | | | | | | | | | - The _modules cache now uses the full module name. - The meaning of the (internal!!!) inpackage argument is changed: it now is the parent package name, or None. readmodule() doesn't support this argument any more. - The meaning of the path argument is changed: when inpackage is set, the module *must* be found in this path (as is the case for the real package search). - Miscellaneous cleanup, e.g. fixed __all__, changed some comments and doc strings, etc. - Adapted the unit tests to the new semantics (nothing much changed, really). Added some debugging code to the unit tests that print helpful extra info to stderr when a test fails (interpreting the test failures turned out to be hard without these).
* When recursively attempting to find the modules imported by anGuido van Rossum2002-09-161-2/+10
| | | | | "import" statement, catch and ignore all exceptions. add/fix some comments about this.
* Rewritten using the tokenize module, which gives us a real tokenizerGuido van Rossum2002-08-231-188/+144
| | | | | | rather than a number of approximating regular expressions. Alas, it is 3-4 times slower. Let that be a challenge for the tokenize module.
* Remove uses of the string and types modules:Walter Dörwald2002-06-031-9/+4
| | | | | | | | | | | | | | | | | | | | | | x in string.whitespace => x.isspace() type(x) in types.StringTypes => isinstance(x, basestring) isinstance(x, types.StringTypes) => isinstance(x, basestring) type(x) is types.StringType => isinstance(x, str) type(x) == types.StringType => isinstance(x, str) string.split(x, ...) => x.split(...) string.join(x, y) => y.join(x) string.zfill(x, ...) => x.zfill(...) string.count(x, ...) => x.count(...) hasattr(types, "UnicodeType") => try: unicode except NameError: type(x) != types.TupleTuple => not isinstance(x, tuple) isinstance(x, types.TupleType) => isinstance(x, tuple) type(x) is types.IntType => isinstance(x, int) Do not mention the string module in the rlcompleter docstring. This partially applies SF patch http://www.python.org/sf/562373 (with basestring instead of string). (It excludes the changes to unittest.py and does not change the os.stat stuff.)
* Replaced .keys() with dictionary iteratorsRaymond Hettinger2002-06-021-1/+1
|
* SF 563203. Replaced 'has_key()' with 'in'.Raymond Hettinger2002-06-011-6/+6
|
* SF bug #473525 pyclbr brokenTim Peters2001-10-241-5/+6
| | | | | | | | As the comments in the module implied, pyclbr was easily confused by "strange stuff" inside single- (but not triple-) quoted strings. It isn't anymore. Its behavior remains flaky in the presence of nested functions and classes, though. Bugfix candidate.
* Nick Mathewson: Make sure the recursion is handled properly.Fred Drake2001-08-131-4/+4
| | | | This is part of SF patch #440292.
* Remove unused variable 'imports' from readmodule_ex().Guido van Rossum2001-08-131-1/+0
|
* Patch #444359: Remove unused imports.Martin v. Löwis2001-08-021-1/+0
|
* __all__ for several more modulesSkip Montanaro2001-02-121-0/+2
|
* Whitespace normalization.Tim Peters2001-02-091-1/+0
|
* String method conversion.Eric S. Raymond2001-02-091-11/+12
|
* Whitespace normalization.Tim Peters2001-01-151-244/+244
|
* Actually, the previous batch's comment should have been different;Guido van Rossum2000-02-041-2/+2
| | | | | | | | | | *this* set of patches is Ka-Ping's final sweep: The attached patches update the standard library so that all modules have docstrings beginning with one-line summaries. A new docstring was added to formatter. The docstring for os.py was updated to mention nt, os2, ce in addition to posix, dos, mac.
* Suppress warning print statements about modules not found, they areGuido van Rossum1999-06-161-2/+3
| | | | confusing to end users of IDEs.
* Added a few more bugs to the doc string; reformatted existing bugs.Guido van Rossum1999-06-101-8/+23
|
* Co-production with Tim Peters, implementing a suggestion by MarkGuido van Rossum1999-06-101-6/+31
| | | | | | Hammond: record top-level functions (as Function instances, a simple subclass of Class). You must use the new interface readmodule_ex() to get these, though.
* Fix by Sjoerd for a package related bug: If you have a non-empyGuido van Rossum1999-06-091-6/+6
| | | | | | | | | | | | | | __init__.py it isn't read. (Sjoerd just came up with this, so it's not heavily tested.) Other (yet unsolved) package problems noted by Sjoerd: - If you have a package and a module inside that or another package with the same name, module caching doesn't work properly since the key is the base name of the module/package. - The only entry that is returned when you readmodule a package is a __path__ whose value is a list which confuses certain class browsers that I wrote. (Hm, this could be construed as a feature.)
* Tim Peters: Taught it more "real Python" rules without slowing itGuido van Rossum1999-06-081-47/+53
| | | | | | | | | | appreciably. Triple-quoted strings no longer confuse it, nor nested classes or defs, nor comments starting in column 1. Chews thru Tkinter.py in < 3 seconds for me; doctest.py no longer confuses it; no longer missing methods in PyShell.py; etc. Also captures defs starting in column 1 now, but ignores them; an interface should be added so that IDLE's class browser can show the top-level functions too.
* Experimental speedup patch by Tim Peters (please test!):Guido van Rossum1999-06-071-82/+149
| | | | | | | | | It wasn't hard to speed pyclbr by a factor of 3, and I'll attach an experimental patch for that (experimental because barely tested). Uncomment the new "String" stuff and it will deal with strings correctly (pyclbr currently ignores the possibility), but that slows it down a lot. Still faster in the end than current pyclbr, but-- frankly --I'd rather have the dramatic speedup!
* Bow to font-lock at the end of the docstring, since it throws stuffFred Drake1999-02-181-2/+2
| | | | | | | off. Make sure the path paramter to readmodule() is a list before adding it with sys.path, or the addition could fail.
* Ever-so-slight improvementL the patterns to recognize importGuido van Rossum1998-10-131-2/+2
| | | | statements now also stop at ';' (formerly they only stopped at '#').
* Enhancements by Sjoerd Mullender: support forGuido van Rossum1998-10-121-7/+7
| | | | | from a.b import c import a . b
* Add support for dotted module names to readmodule().Guido van Rossum1998-10-121-18/+26
|
* re -> regex conversions by Sjoerd.Guido van Rossum1997-10-241-23/+29
|
* Don't add names that start with _Guido van Rossum1996-10-101-1/+4
|
* Also remember the module a class is defined in.Sjoerd Mullender1995-11-021-2/+3
|
* Module with one function to read Python modules and extract class andSjoerd Mullender1995-07-281-0/+204
method definitions. See __doc__ string for more information.