You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When attempting to redefine the same route in Jupyter Notebook using a different function name, such as specifying the HTTP verb (get()) and the route (change()), the content of the route does not update as expected.
Issue
When running the following code in a cell, the browser correctly displays "Change is good!":
@rt("/change")defget():
returnP("Change is good!")
However, when I attempt to redefine the same route with the function name matching the route in the next cell, as shown below, the browser still displays "Change is good!" instead of the updated content:
@rt("/change")defchange():
returnP("Change is better! - Without specifying the HTTP verb as 'get()'")
I checked the app.routes to investigate the issue, and I found that the "/change" route is being registered twice with the same method (GET), as shown in the output:
The route should pick the most recently defined handler for the route /change instead of retaining the previous one. The issue may be that duplicate routes with the same method (GET) are not being handled correctly.
Description
When attempting to redefine the same route in Jupyter Notebook using a different function name, such as specifying the HTTP verb (
get()
) and the route (change()
), the content of the route does not update as expected.Issue
When running the following code in a cell, the browser correctly displays "Change is good!":
However, when I attempt to redefine the same route with the function name matching the route in the next cell, as shown below, the browser still displays "Change is good!" instead of the updated content:
I checked the
app.routes
to investigate the issue, and I found that the "/change" route is being registered twice with the same method (GET
), as shown in the output:Expected Behavior
The route should pick the most recently defined handler for the route
/change
instead of retaining the previous one. The issue may be that duplicate routes with the same method (GET
) are not being handled correctly.Is this behavior expected, or is this a bug?
Environment Information
Please provide the following version information:
Confirmation
Please confirm the following:
The text was updated successfully, but these errors were encountered: