~ubuntu-branches/ubuntu/precise/python3.2/precise-proposed

« back to all changes in this revision

Viewing changes to Objects/dictobject.c

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2012-03-09 18:40:39 UTC
  • mfrom: (30.1.2 sid)
  • Revision ID: package-import@ubuntu.com-20120309184039-j3yk2emxr1plyo21
Tags: 3.2.3~rc1-1
* Python 3.2.3 release candidate 1.
* Update to 20120309 from the 3.2 branch.
* Fix libpython.a symlink. Closes: #660146.
* Build-depend on xauth.
* Run the gdb tests for the debug build only.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1314
1314
        PyObject *key;
1315
1315
        Py_hash_t hash;
1316
1316
 
1317
 
        if (dictresize(mp, Py_SIZE(seq)))
 
1317
        if (dictresize(mp, Py_SIZE(seq))) {
 
1318
            Py_DECREF(d);
1318
1319
            return NULL;
 
1320
        }
1319
1321
 
1320
1322
        while (_PyDict_Next(seq, &pos, &key, &oldvalue, &hash)) {
1321
1323
            Py_INCREF(key);
1322
1324
            Py_INCREF(value);
1323
 
            if (insertdict(mp, key, hash, value))
 
1325
            if (insertdict(mp, key, hash, value)) {
 
1326
                Py_DECREF(d);
1324
1327
                return NULL;
 
1328
            }
1325
1329
        }
1326
1330
        return d;
1327
1331
    }
1332
1336
        PyObject *key;
1333
1337
        Py_hash_t hash;
1334
1338
 
1335
 
        if (dictresize(mp, PySet_GET_SIZE(seq)))
 
1339
        if (dictresize(mp, PySet_GET_SIZE(seq))) {
 
1340
            Py_DECREF(d);
1336
1341
            return NULL;
 
1342
        }
1337
1343
 
1338
1344
        while (_PySet_NextEntry(seq, &pos, &key, &hash)) {
1339
1345
            Py_INCREF(key);
1340
1346
            Py_INCREF(value);
1341
 
            if (insertdict(mp, key, hash, value))
 
1347
            if (insertdict(mp, key, hash, value)) {
 
1348
                Py_DECREF(d);
1342
1349
                return NULL;
 
1350
            }
1343
1351
        }
1344
1352
        return d;
1345
1353
    }
1965
1973
2-tuple; but raise KeyError if D is empty.");
1966
1974
 
1967
1975
PyDoc_STRVAR(update__doc__,
1968
 
"D.update(E, **F) -> None.  Update D from dict/iterable E and F.\n"
1969
 
"If E has a .keys() method, does:     for k in E: D[k] = E[k]\n\
1970
 
If E lacks .keys() method, does:     for (k, v) in E: D[k] = v\n\
 
1976
"D.update([E, ]**F) -> None.  Update D from dict/iterable E and F.\n"
 
1977
"If E present and has a .keys() method, does:     for k in E: D[k] = E[k]\n\
 
1978
If E present and lacks .keys() method, does:     for (k, v) in E: D[k] = v\n\
1971
1979
In either case, this is followed by: for k in F: D[k] = F[k]");
1972
1980
 
1973
1981
PyDoc_STRVAR(fromkeys__doc__,