2 ms·
It bothers me when the constructs of the language are not used for things like this. Example, the syntax for a list of ints is `List[int]` as opposed to `list(i
by whalesalad 10y ago
It bothers me when the constructs of the language are not used for things like this. Example, the syntax for a list of ints is `List[int]` as opposed to `list(int)` where list is an actual fn in python and so it makes more sense. Obviously list(int) has far different meaning, but List is a totally foreign thing in Python. I think it makes sense for a DSL to remain as close to the parent as possible.
Another example of this is most of the prismatic/schema-esque frameworks for python to do validation on datastructures. Instead of saying foo must be { "name": "String" } (where there is a framework-specific meaning behind the literal word "String") we should take advantage of the built-in types and say {"name": basestring}.
End rant.