bottlepy / bottle

bottle.py is a fast and simple micro-framework for python web-applications.
http://bottlepy.org/
MIT License
8.39k stars 1.47k forks source link

Enhancement Request: Add Type Annotations #1362

Open garrett-s-wininger opened 2 years ago

garrett-s-wininger commented 2 years ago

Hello all,

I'm currently working on a Pysa contribution to annotate potential places where user-controlled data may be received from web servers. Bottle is one of the frameworks that caught our attention and to supplement the contribution, I'd love it if we could provide type annotations for the library as they are generally required to get good signal from Pysa analysis. I've got a PYI stub for Pyre I'm working on to get my analysis to work so was wondering if the maintaining team here would be willing to accept it once complete or, if not, whether there would be any issue trying to send it to the upstream Python typeshed.

Looking forward to hearing back!

defnull commented 2 years ago

I do not have any experience with Pyre so maintaining these definitions might be tricky in the long run. Contributing to typeshed might be a more sustainable option.

ilrico commented 1 year ago

Indeed typeshed studs would enable pyright support right away.
pyright issue with bottle.FormsDict

defnull commented 3 weeks ago

Starting with 0.13 we are dropping support for ancient python versions. 0.14 (or 1.0) will drop Support for Python 2. This means we can FINALLY start adding type annotations without triggering SyntaxError on older python releases.