Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(2)  |  Call(2)  |  Derive(0)  |  Import(0)
Import unset keys from another dict.

This method lets you update the dict using defaults from another
dict and/or using keyword arguments.  It's like the standard update()
method except that it doesn't overwrite existing keys.

src/m/o/mozservices-HEAD/mozsvc/tests/test_config.py   mozservices(Download)
            "four": 4,
        })
        settings.setdefaults({"a.two": "TWO", "a.five": 5, "new": "key"})
        self.assertEquals(settings.getsection("a"),
                          {"one": 1, "two": 2, "five": 5})

src/m/o/mozsvc-0.7/mozsvc/tests/test_config.py   mozsvc(Download)
          "four": 4,
        })
        settings.setdefaults({"a.two": "TWO", "a.five": 5, "new": "key"})
        self.assertEquals(settings.getsection("a"),
                         {"one": 1, "two": 2, "five": 5})