heroku-python / flask-sockets

[DEPRECATED] Alternative: https://github.com/miguelgrinberg/flask-sock
MIT License
1.74k stars 167 forks source link

Sockets.route should preserve handler docstrings/annotations/etc. #50

Closed achimnol closed 7 years ago

achimnol commented 7 years ago

The original Flask framework uses functools.update_wrapper() for handler registration methods such as add_url_rule() so that docstrings, annotations, and other metadata of the app.route()-wrapped function becomes equivalent to those of the original user-defined handler function. To be consistent, Sockets.route() or Sockets.add_url_rule() method should do this as well.

tkrajca commented 7 years ago

Cool, @achimnol have you got a pull request?

achimnol commented 7 years ago

Ooops, I pointed the wrong stuff. Sockets.route() is working as expected, since the decorator just returns f as-is and only calls add_url_rule() as a side-effect. The root cause of my problem was a missing entry in __all__. Sorry for bothering. 😞 (We should not write codes when sleepy..... 😪)