3 ms·
> For these cases, typing rules and annotations will be a boon. You can use PEP3107 annotations today and automatically validate them using a decorator to elim
by kevin_thibedeau 12y ago
> For these cases, typing rules and annotations will be a boon.
You can use PEP3107 annotations today and automatically validate them using a decorator to eliminate boilerplate code like that. They don't have to be something to look forward to tomorrow.
- ak217 12y agoRelated: https://github.com/kislyuk/ensure 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