module documentation

Undocumented

Class ​Fast​Encoding​Buffer a very rudimentary buffer that is faster than StringIO, but doesn't crash on unicode data like cStringIO.
Class ​LRUCache A dictionary-like object that stores a limited number of items, discarding lesser used items periodically.
Class memoized​_instancemethod Decorate a method memoize its return value.
Class memoized​_property A read-only @property that is only evaluated once.
Class ​Plugin​Loader Undocumented
Class ​Set​Like​Dict a dictionary that has some setlike methods on it
Function parse​_encoding Deduce the encoding of a Python source file (binary mode) from magic comment.
Function read​_file Undocumented
Function read​_python​_file Undocumented
Function restore​_​_ast Attempt to restore the required classes to the _ast module if it appears to be missing them
Function sorted​_dict​_repr repr() a dictionary with the keys in order.
Function to​_list Undocumented
Function update​_wrapper Undocumented
Function verify​_directory create and/or verify a filesystem directory.
Variable _​PYTHON_​MAGIC_​COMMENT_re Undocumented
def parse_encoding(fp):

Deduce the encoding of a Python source file (binary mode) from magic comment.

It does this in the same way as the Python interpreter

The fp argument should be a seekable file object in binary mode.

def read_file(path, mode='rb'):

Undocumented

def read_python_file(path):

Undocumented

def restore__ast(_ast):
Attempt to restore the required classes to the _ast module if it appears to be missing them
def sorted_dict_repr(d):

repr() a dictionary with the keys in order.

Used by the lexer unit test to compare parse trees based on strings.

def to_list(x, default=None):

Undocumented

def update_wrapper(decorated, fn):

Undocumented

def verify_directory(dir_):
create and/or verify a filesystem directory.
_PYTHON_MAGIC_COMMENT_re =

Undocumented