How sure works

The class sure.AssertionBuilder creates objects capable of doing assertions. The AssertionBuilder simply arranges a vast set of possible assertions that are composed by a source object and a destination object.

Every assertion, even implicitly if implicitly like in (2 < 3), is doing a source/destination matching.


Some specific assertion methods are chainable, it can be useful for short assertions like:

  "name": "John",
  "facebook_info": {
    "token": "abcd"



Lincoln Clarete has written the module [sure/] which I simply added to sure. The most exciting part of the story is that Lincoln exposed the code with a super clean API, it’s called forbidden fruit

Why CPython-only ?

Sure uses the ctypes module to break in python protections against monkey patching.

Although ctypes might also be available in other implementations such as Jython, only the CPython provide `ctypes.pythonapi <>`__ the features required by sure.