Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Yikes. I'm going to follow this one cause it's right up my alley, but I'm worried I will absolutely hate the process if some standards don't change, e.g. having to have multiple functions called "get()" for them to be a GET request is going to drive mypy/flake8 mad.


You can just use `@app.get` and name your function whatever you like, just like FastAPI, if you prefer.

Although I don't see why flake8 should care - multi-dispatch is built into the python stdlib so having multiple functions with the same name is not weird or new.


Thanks for the info. In general, being compliant with established conventions (even if you don't personally like them) can lower the barrier of entry for some people who may superficially reject your library based on esthetic concerns.

If you'd like to dig deeper, the reference is:

    F811 redefinition of unused 'get' from line xx 
from flake8 and

    error: Name "get" already defined on line xx  [no-redef]
from mypy.


But you would have these 'get' functions in different modules though, so how would it be a 'redefinition'?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: