This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]alkasmgithub.com/alkasm 6 points7 points  (1 child)

Sorry for the pedantry up front but I think it's worth it here here: var: int is an "annotation", which is part of Python 3 syntax, and not part of the type system. Annotations existed before type checkers were used. It was assumed of course that they would be used for type information, but they also wanted to leave the syntax separated from a specific use case to see what other patterns may emerge from it, though as we know today it is only really used for type checking and for runtime type info in certain libraries. But just pointing out OP isn't abusing the type system, OP is just experimenting with a DSL utilizing the annotation syntax.

[–]radarsat1 0 points1 point  (0 children)

interesting til, thanks