News for hackers. Stuff that matters.
Re:Type checking in Python by willvarfar on Sunday May 18, 2014 @10:02AM (#7763082)
I've been checking types in Python dynamically for years now. My library, Obiwan https://pypi.python.org/pypi/obiwan/1.0.2 uses type annotations, which I think nicer than decorators.
Re:Type checking in Python by andybak on Sunday May 18, 2014 @10:11AM (#7763104)
As the article mentions - the big advantage of decorators is Python 2.x compatibility. (not that I want to start another discussion of THAT topic)

EDIT - looks like obiwan will allow decorators as well as annotations. I do prefer the syntax of typedecorator though. It seems less cluttered.

Re:Type checking in Python by andreasvc on Sunday May 18, 2014 @10:34AM (#7763170)
It's a matter of taste. I think the decorator approach looks more bolted-on and ad hoc. I prefer C style declarations over annotations, though, because they have the least amount of noise.
Re:Type checking in Python by jbeja on Sunday May 18, 2014 @10:25AM (#7763146)
This actually looks pretty good.