Developer tools
Project description
Xdev - Excellent Developer
Xdev is an excellent developer tool for excellent developers. It contains miscellaneous and/or interactive debugging tools.
I mostly maintain this for myself, but I could see polishing it up in the future.
Remarks
Perhaps I should just use ipdb but I often just like to directly embed with IPython whenever I want:
import xdev
xdev.embed()
Or wherever I want whenever there is an exception.
import xdev
with xdev.embed_on_exception_context:
some_code()
I don’t feel like I need ipdb’s other features.
I also like to
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
"""
But I know these things are a little dirty.
But these aren’t production practices. These are development tricks and life hacks to make working faster.
Also see xinspect for things like autogen_imports
>>> 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']
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.