A python library using private/hidden python language features
Click here for the documentation
There are no published packages yet. Soon you will be able to pip install...
- Dictionary mutation checker (Python 3.6 only), inspired by Jake VanderPlas' excellent post about python 3.6's private dict version.
fromprivatesimportno_mutationsx= {a: 1, b: 2}
withno_mutations(x):
value=x['a'] # this is finewithno_mutations(x):
x['c'] =3# this will throw a MutationError# The mutation check is `ex-post`,# therefore the change is still made.assert'c'inx- A
NamedStructto facilitate calling external native/jitted APIs, which allows inheritance of attributes, among other behaviours. This also features as a betternamedtuple/typing.NamedTuple, without the errors and performance issues of the existing implementations.
fromprivatesimportNamedStructclassPoint(NamedStruct):
x: inty: intclassRectangle(Point):
height: intwidth: intdefarea(self):
returnself.height*self.width# This creates a `numba` jitclass.r=Rectangle.create(x=0, y=0, height=3, width=4)
assertr.area() ==12- To report a bug, please open a PR with a new (failing) unit-test showing the problem.
- To request a feature, please open a PR with a new (failing) unit-test showing the preferred API.
- To make a contribution, please open a PR with new (passing) unit-tests, inline doctest examples and documentation updates.
- Python 3.6 or later
- py.test
- coverage
- numba >= 0.33