Skip to content
Myr

remove _blueprint_order, dicts are ordered

Before adoption: this commit came in with the history the project adopted, so no landing records it.

This code originates from supporting Python 2.4. Dicts are ordered in supported Pythons as of 3.6. An OrderedDict could be used to indicate that order matters, but is not since we don't rely on the implementation differences.

authored by pgjones · committed by David Lord · parent fd62210 · Browse files · 1 file+5 added−6 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+5 added−6 removed

  • other:+5 added−6 removed

1 file+5 added−6 removed

modified:src/flask/app.py+5 added-6 removed
428 unmodified lines
429 #:430 #: .. versionadded:: 0.11431 self.shell_context_processors = []432433 #: all the attached blueprints in a dictionary by name. Blueprints434 #: can be attached multiple times so this dictionary does not tell435 #: you how often they got attached.433 #: Maps registered blueprint names to blueprint objects. The434 #: dict retains the order the blueprints were registered in.435 #: Blueprints can be registered multiple times, this dict does436 #: not track how often they were attached.437 #:438 #: .. versionadded:: 0.7439 self.blueprints = {}439 self._blueprint_order = []440441 #: a place where extensions can store application specific state. For442 #: example this is where an extension could store database engines and443 #: similar things.
552 unmodified lines
996 f" names."997 )998 else:999 self.blueprints[blueprint.name] = blueprint1000 self._blueprint_order.append(blueprint)1000 first_registration = True10011002 blueprint.register(self, options, first_registration)1003
1 unmodified line
1005 """Iterates over all blueprints by the order they were registered.10061007 .. versionadded:: 0.111008 """1010 return iter(self._blueprint_order)1009 return self.blueprints.values()10101011 @setupmethod1012 def add_url_rule(1013 self,
1018 unmodified lines