Reputation: 225
The webapp2.WSGIApplication class is initialized with three arguments:
Why is the first argument a list of tuples and not a dictionary?
Upvotes: 0
Views: 324
Reputation: 2832
My guess is that the order of the tuples is important, and a dictionary has no order.
app = webapp2.WSGIApplication([
('/this page', ThisPageHandler),
('.*', FrontPage),
],debug=False)
If that was your app above, it's important to catch the /this_page
route before the catch all .*
is caught. A list preserves order where a dictionary does not.
Upvotes: 1