Types for Python HTTP APIs
instagram-engineering.com
Types for Python HTTP APIs
1–10 of 55 posts
Re: Types for Python HTTP APIs
#2Re: Types for Python HTTP APIs
#3Looks like FastAPI framework with handler type anotations
Re: Types for Python HTTP APIs
#4Re: Types for Python HTTP APIs
#5The whole Type thing in Python and all the workarounds to make Python type-safish looks and feels absolutely pathetic. I have no idea why a company like Facebook takes so much time to apologize for the inadequacy of Python as a programming language in the broader sense. Especially since they are utilizing a service based architecture they easily could make the switch to a language that actually supports types. Also t…
Re: Types for Python HTTP APIs
#6The whole Type thing in Python and all the workarounds to make Python type-safish looks and feels absolutely pathetic. I have no idea why a company like Facebook takes so much time to apologize for the inadequacy of Python as a programming language in the broader sense. Especially since they are utilizing a service based architecture they easily could make the switch to a language that actually supports types. Also t…
Re: Types for Python HTTP APIs
#7The whole Type thing in Python and all the workarounds to make Python type-safish looks and feels absolutely pathetic. I have no idea why a company like Facebook takes so much time to apologize for the inadequacy of Python as a programming language in the broader sense. Especially since they are utilizing a service based architecture they easily could make the switch to a language that actually supports types. Also t…
They articles says it is mostly a monolith with several millions line of code.
Re: Types for Python HTTP APIs
#8 @annotate(foo=int, bar=str)
def view_func(foo=0, bar='hi there'):
...
The types could also be arbitrary callables to parse things like datetime and what not. I'd parse the params from either the get params or post data (json, urlencoded, etc).But now I'm using graphene and graphql to handle all this -- it's a better way to do all of it imho. Of course this all came along after instagram, so you didn't have that choice back then.
Re: Types for Python HTTP APIs
#9Re: Types for Python HTTP APIs
#10I’ve been working on a similar solution for Flask in K Health. Currently we have great serialisation / deserialisation from types to JSON, next step will be creating OpenAPI documents