Skip to content

Repository files navigation

privates

Build StatuscodecovCodacy BadgeDocumentation Status

A python library using private/hidden python language features

documentation

Click here for the documentation

installation

There are no published packages yet. Soon you will be able to pip install...

features

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 NamedStruct to facilitate calling external native/jitted APIs, which allows inheritance of attributes, among other behaviours. This also features as a better namedtuple/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

development/contributing

  • 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.

requirements

  • Python 3.6 or later
  • py.test
  • coverage
  • numba >= 0.33

About

A python library using private/hidden features

Topics

Resources

Stars

2 stars

Watchers

4 watching

Forks

Releases

Packages

Contributors

Languages