The xinspect module
Project description
Tools for static and dynamic code introspection. This library has not been well maintained, and there are likely other libraries that are better.
Helps with writing doctests
def func(a=1, b=2, c=3):
"""
Example:
>>> from this.module import * # import contextual namespace
>>> import xinspect
>>> globals().update(xinspect.get_func_kwargs(func)) # populates globals with default kwarg value
>>> print(a + b + c)
6
"""
Helps with code that generates code
>>> import ubelt as ub
>>> source = ub.codeblock(
>>> '''
>>> p = os.path.dirname(join('a', 'b'))
>>> glob.glob(p)
>>> ''')
>>> # Generate a list of lines to fix the name errors
>>> lines = autogen_imports(source=source)
>>> print(lines)
['import glob', 'from os.path import join', 'import os']
See Also: https://github.com/Erotemic/xdev
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
xinspect-0.4.0.tar.gz
(23.2 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
xinspect-0.4.0-py3-none-any.whl
(19.1 kB
view details)
File details
Details for the file xinspect-0.4.0.tar.gz.
File metadata
- Download URL: xinspect-0.4.0.tar.gz
- Upload date:
- Size: 23.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5329d72d5be78e06945e4a95b485c9a50b1faeca67cbfff6040099a36d992c02
|
|
| MD5 |
5517e03614cefa43d5fccad2c5a66e70
|
|
| BLAKE2b-256 |
30624e484fcd649d64d78920943878e925a2ce135bce85245d5de9702920acb0
|
File details
Details for the file xinspect-0.4.0-py3-none-any.whl.
File metadata
- Download URL: xinspect-0.4.0-py3-none-any.whl
- Upload date:
- Size: 19.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9be1763b96174a5368dd34b4fde0eaf790ee4dd9e0316ae05037e1e203015011
|
|
| MD5 |
1cb81abe442034329aa0430c244e7fb4
|
|
| BLAKE2b-256 |
7f2062f45a1518b1b5913328a3d7a0bdc1f77c9be52c531fc8367b0513e8ecac
|