3 ms·
True, but large systems are just, well, large. I'm not thinking startup land here, but entrenched applications in bigger businesses that grow organically to mee
by mickeyp 14y ago
True, but large systems are just, well, large. I'm not thinking startup land here, but entrenched applications in bigger businesses that grow organically to meet the need of the business.
Python 3 does have type annotations for use by linting tools, but it'll be another 5-6 years before we'll see that filter down into the current Python ecosystem. And even then, it's only as good as the weakest (non-annotated) piece of code. Retrofitting libraries and existing code will bring about its own issues: how do you accurately hint to linters, in a language that encourages duck typing, the type a method parameter is likely to take?
- berntb 14y ago>>how do you accurately hint to linters, in a language that encourages duck typing, the type a method parameter is likely to take? You didn't check the Method::Signatures link or do I misunderstand your position? Also check Moose@CPAN, which have typing of object attributes. It isn't like a fully typed language, but it should help a lot. Edit: Link discussing type checking of attributes in Perl. Should be possible to have something similar in other dynamic languages? http://search.cpan.org/~doy/Moose-2.0602/lib/Moose/Util/TypeConstraints.pm http://search.cpan.org/~doy/Moose-2.0602/lib/Moose/Util/Type... Edit: Please check the links and see if Perl solves your problems? I am curious. (-: Writing a PEP to get something similar into Python is optional. :-)
- mickeyp 14y agoI didn't look, tbh. Python 3 already has type annotations, but what interests me if how do you nail down types whilst preserving duck typing, or dealing with a method that is already passed duck typed objects.
- berntb 14y agoI'm not going to copy/paste the content/source from links I've given. :-) (There are easy-to-read abstracts/"synopsis" at the start of both pages.)
- regularfry 14y agoI'd have thought that taking a leaf out of Go's book and having passively-defined interfaces would be a useful concept for linter hints.