Skip to content Skip to sidebar Skip to footer
Showing posts with the label Typing

Clean And Type-safe State Machine Implementation In A Statically Typed Language?

I implemented a simple state machine in Python: import time def a(): print 'a()' r… Read more Clean And Type-safe State Machine Implementation In A Statically Typed Language?

What Are Built-in Python 3 Types That Can Be Compared To Each Other?

In Python 2, it was possible to compare objects of different types such as int to str by having an … Read more What Are Built-in Python 3 Types That Can Be Compared To Each Other?

How Do I Type-hint That A Python Function Returns Instance Of Any Class Derived From A Superclass?

I've got a bunch of Django template inclusion tags, which take as an argument either a specific… Read more How Do I Type-hint That A Python Function Returns Instance Of Any Class Derived From A Superclass?

How To Define An Alias For A Type In Python For Type Hinting

How to define an alias for a type to use type hint: import typing type Ticker str # How to do this?… Read more How To Define An Alias For A Type In Python For Type Hinting