4 ms·
This is the single biggest thing I miss coming from modern Perl. Pythonistas seem very anti-type validation/checking, but with Moose classes the type stuff simp
by csirac2 12y ago
This is the single biggest thing I miss coming from modern Perl. Pythonistas seem very anti-type validation/checking, but with Moose classes the type stuff simplifies a lot, is declarative, self documenting, and vastly reduces certain classes of bugs.
The closest I've seen is the traits thing from Enthought, but there doesn't seem to be much buy-in from python users.
- hershel 12y agoThrees also the mypy project which offers optional static typing in python, if you're interested in such stuff.
- pekk 12y agoIf you write APIs which only accept this one type, then you are explicitly disallowing people from using types that are functionally equivalent as far as the API is concerned. Why should you do that?
- csirac2 12y agoThat's not how these trait/type systems work.
- doctoboggan 12y agoFormer Enthought employee here, I always liked programming with Traits. Although nowadays I use the similar but much for light weight atom[0], which was created by another former Enthoughter. [0]: https://github.com/nucleic/atom https://github.com/nucleic/atom
- csirac2 12y agoAwesome pointer, thanks!