Skip to content

Instantly share code, notes, and snippets.

@harjitmoe
harjitmoe / uninames.py
Created September 26, 2016 20:26
Proof-of-concept Python preprocessing for Unicode variable names.
# -*- mode: python; coding: utf-8 -*-
"""Unicode Names preprocessor for Python 2."""
# Modified from tokenize module as support for parsing Unicode names
# had to be added.
old_doc = """Tokenization help for Python programs.
generate_tokens(readline) is a generator that breaks a stream of
text into Python tokens. It accepts a readline-like method which is called
@harjitmoe
harjitmoe / regexp.py
Last active September 20, 2016 14:13
Simple, very classic Python RegExp API for modern Python
r"""Older, simpler interface for simple RegEx operations.
Simple regular expression interface compatible with historic regexp
module (based on the regexp.py from Python 1.1, which was included
without modification in subseqent versions before eventual
deletion).
Ported by Thomas Hori to use the "re" API rather than the previous
"regex" module from Python 1.x as its backend.