Ticket #3192: dict-to-update.diff

File dict-to-update.diff, 559 bytes (added by Jeremy Dunck <jdunck@…>, 17 years ago)

Another diff in case preference is to enforce in Context.update rather than RequestContext.init

  • template/context.py

     
    5757
    5858    def update(self, other_dict):
    5959        "Like dict.update(). Pushes an entire dictionary's keys and values onto the context."
     60        if not hasattr(other_dict, '__getitem__'):
     61            raise TypeError, 'Dictionary expected.'
    6062        self.dicts = [other_dict] + self.dicts
    6163
    6264# This is a function rather than module-level procedural code because we only
Back to Top