Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A problem with annotation for "add_url_rule" #1

Closed
wenbo1188 opened this issue Aug 13, 2018 · 1 comment
Closed

A problem with annotation for "add_url_rule" #1

wenbo1188 opened this issue Aug 13, 2018 · 1 comment

Comments

@wenbo1188
Copy link

  • I've been reading your annotation for source code of Flask-0.1. And I found maybe something wrong with the function "add_url_rule".

  • I check the original version of api annotation in http://docs.jinkan.org/docs/flask/api.html#id2

  • It says

      Basically this example:
    
      @app.route('/')
      def index():
          pass
      Is equivalent to the following:
    
      def index():
          pass
      app.add_url_rule('/', 'index', index)
    
  • But in your annotation it says

      基本示例:
    
          @app.route('/')
          def index():
              pass
    
      和下面相同:
    
          def index():
              pass
          app.add_url_rule('index', '/')
          app.view_functions['index'] = index
    
  • The sequence of param rule and endpoint is wrong. Maybe it;s a mistake in writing?

@greyli
Copy link
Member

greyli commented Aug 13, 2018

Thanks for the feedback! It's a mistake from the raw flask.py, I will fix it as soon as possible. If the next time you find something wrong, just propose a PR :)

@greyli greyli closed this as completed Aug 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants