Hacker GitHub

← All repos

kislyuk/ensure

View on GitHub ↗ ★ 157 Python

Validate conditions, Python style.

13 mentions on Hacker News by 2 people: 1 story, 12 comments · first 2013-11-04 · latest 2017-11-05

Mentions per year 13 mentions · busiest year 2014 (6)
20082026
  1. unittest with https://github.com/kislyuk/ensure
  2. Fine, but it's just an import away: https://github.com/kislyuk/ensure (written by HN user ak217)
  3. Thanks for the link. I developed the annotation+decorator-based type checker in https://github.com/kislyuk/ensure before I saw typecheck-decorator (which looks like it has some cool features). One thing I'm proud of with ensure's…
    comment by ak217 · 2015-05-23 · in PEP 0484 – Type Hints is accepted
  4. My contribution is https://github.com/kislyuk/ensure It's fast and doesn't monkey-patch things.
    comment by ak217 · 2015-01-06 · in Type hinting for Python
  5. Related: https://github.com/kislyuk/ensure A (relatively) high performance runtime annotation type checker. from ensure import ensure_annotations @ensure_annotations def f(x: int, y: float) -> float: return x+y
  6. …library to do optional type checking at runtime with no need for a special interpreter :) https://github.com/kislyuk/ensure (Having optional static type checks in the core interpreter would be nice, though Alex Gaynor's concerns linked in…
  7. …) and things they enable like optional runtime type checking ( https://github.com/kislyuk/ensure#enforcing-function-annotat... ). Also, as a library developer, I wanted to highlight some facts from experience with Python
    comment by ak217 · 2014-06-29 · in Python 3 Features
  8. …there on how to do optional runtime type checking in a Pythonic way. My contribution is ensure ( https://github.com/kislyuk/ensure ), for example check out the ensure_annotations decorator ( https://ensure.readthedocs.org/en/latest/#ensure.…
  9. …added optional type checking based on function annotations and decorators to the Ensure library: https://github.com/kislyuk/ensure#enforcing-function-annotat... . @ensure_annotations def f(x: int, y: float) -> float: return x+y f(1, 2.3)…
    comment by ak217 · 2014-05-19 · in Type checking in Python
  10. I've added a type checking decorator for function annotations to my assertions helper library, https://github.com/kislyuk/ensure : from ensure import ensure_annotations @ensure_annotations def f(x: int, y: float) -> float: return x+y f(1,…
  11. I wrote a library so you don't have to use this: https://github.com/kislyuk/ensure (Though I know how frustrating exception juggling can get... especially when they get pickled and re-raised)
  12. …utility and expressiveness of Python assertions, so I wrote a library for expressive assertions: https://github.com/kislyuk/ensure It's inspired by ensure.js, and defines a large (and growing) number of helpers to make assertions concise,…
    comment by ak217 · 2013-11-18 · in When to use assert