Mercurial > cpython-lru_cache-weakref
comparison Lib/codehack.py @ 1746:1940892d2fe3 legacy-trunk
Merge alpha100 branch back to main trunk
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Mon, 01 Aug 1994 11:34:53 +0000 |
| parents | e7571a18bdef |
| children | 91aea1af654f |
comparison
equal
deleted
inserted
replaced
| 1745:d5b67d2ec7ee | 1746:1940892d2fe3 |
|---|---|
| 4 import sys | 4 import sys |
| 5 from stat import * | 5 from stat import * |
| 6 import string | 6 import string |
| 7 import os | 7 import os |
| 8 import linecache | 8 import linecache |
| 9 | |
| 10 # XXX The functions getcodename() and getfuncname() are now obsolete | |
| 11 # XXX as code and function objects now have a name attribute -- | |
| 12 # XXX co.co_name and f.func_name. | |
| 9 | 13 |
| 10 # Extract the function or class name from a code object. | 14 # Extract the function or class name from a code object. |
| 11 # This is a bit of a hack, since a code object doesn't contain | 15 # This is a bit of a hack, since a code object doesn't contain |
| 12 # the name directly. So what do we do: | 16 # the name directly. So what do we do: |
| 13 # - get the filename (which *is* in the code object) | 17 # - get the filename (which *is* in the code object) |
