Skip to content

codebrowse/impish

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Impish

A friendly helper library for the imp module.

Source

Introduction

Impish implements helper methods which wrap imp module functionality to provide a friendlier programming interface with nicer exception handling.

It is MIT-licensed.


###Definitons

imp |imp|
noun
a mischievous child: a cheeky young imp.
• a small, mischievous devil or sprite.

verb [ with obj. ]
repair a damaged feather in (the wing or tail of a trained hawk) by attaching part of a new feather.


impish |ˈimpiSH|
adjective
inclined to do slightly naughty things for fun; mischievous: he had an impish look about him.

DERIVATIVES
impishly adverb,
impishness noun

Source: New Oxford American Dictionary, via Apple OS X Dictionary app.


Examples

1. Finding a module's absolute file path

>>> import impish
>>> impish.find('os').filename
/path/to/os.py

Finding a module's file object

>>> impish.find('os').file
<file object>

>>> impish.find(os).file
<file object>

2. Checking for a built-in

>>> impish.isbuiltin('sys')
True

>>> impish.isbuiltin('os')
False

3. Checking for source

>>> impish.issource('sys')
False

>>> impish.isbuiltin('os')
True

TODOS

  • Add tests for other type checking functions
  • Docstrings
  • Make find work with already imported modules
  • add setup.py file

Impish is a codebrow.se package written by Michael Van Veen.

About

A friendly helper library for the `imp` module.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages