Core and Builtins
-----------------
+ - Issue #24115: Update uses of PyObject_IsTrue(), PyObject_Not(),
+ PyObject_IsInstance(), PyObject_RichCompareBool() and _PyDict_Contains()
+ to check for and handle errors correctly.
+
+- Issue #24328: Fix importing one character extension modules.
+
+- Issue #11205: In dictionary displays, evaluate the key before the value.
+
+- Issue #24285: Fixed regression that prevented importing extension modules
+ from inside packages. Patch by Petr Viktorin.
+
+Library
+-------
+
+- Issue #24326: Fixed audioop.ratecv() with non-default weightB argument.
+ Original patch by David Moore.
+
+- Issue #16991: Add a C implementation of OrderedDict.
+
+
+What's New in Python 3.5.0 beta 1?
+==================================
+
+Release date: 2015-05-24
+
+Core and Builtins
+-----------------
+
+- Issue #24276: Fixed optimization of property descriptor getter.
+
+- Issue #24268: PEP 489: Multi-phase extension module initialization.
+ Patch by Petr Viktorin.
+
+- Issue #23955: Add pyvenv.cfg option to suppress registry/environment
+ lookup for generating sys.path on Windows.
+
- Issue #24257: Fixed system error in the comparison of faked
types.SimpleNamespace.
s->item_separator = item_separator;
s->sort_keys = sort_keys;
s->skipkeys = skipkeys;
- s->fast_encode = (PyCFunction_Check(s->encoder) && PyCFunction_GetFunction(s->encoder) == (PyCFunction)py_encode_basestring_ascii);
+ s->fast_encode = NULL;
+ if (PyCFunction_Check(s->encoder)) {
+ PyCFunction f = PyCFunction_GetFunction(s->encoder);
+ if (f == (PyCFunction)py_encode_basestring_ascii ||
+ f == (PyCFunction)py_encode_basestring) {
+ s->fast_encode = f;
+ }
+ }
- s->allow_nan = PyObject_IsTrue(allow_nan);
+ s->allow_nan = allow_nan;
Py_INCREF(s->markers);
Py_INCREF(s->defaultfn);
/* Make sure both arguments are strings. */
if (!(PyBytes_Check(a) && PyBytes_Check(b))) {
if (Py_BytesWarningFlag && (op == Py_EQ || op == Py_NE)) {
- if (PyObject_IsInstance((PyObject*)a,
- (PyObject*)&PyUnicode_Type) ||
- PyObject_IsInstance((PyObject*)b,
- (PyObject*)&PyUnicode_Type)) {
+ rc = PyObject_IsInstance((PyObject*)a,
+ (PyObject*)&PyUnicode_Type);
+ if (!rc)
+ rc = PyObject_IsInstance((PyObject*)b,
+ (PyObject*)&PyUnicode_Type);
+ if (rc < 0)
+ return NULL;
+ if (rc) {
if (PyErr_WarnEx(PyExc_BytesWarning,
- "Comparison between bytes and string", 1))
+ "Comparison between bytes and string", 1))
return NULL;
}
- else if (PyObject_IsInstance((PyObject*)a,
- (PyObject*)&PyLong_Type) ||
- PyObject_IsInstance((PyObject*)b,
- (PyObject*)&PyLong_Type)) {
- if (PyErr_WarnEx(PyExc_BytesWarning,
- "Comparison between bytes and int", 1))
++ else {
++ rc = PyObject_IsInstance((PyObject*)a,
++ (PyObject*)&PyLong_Type);
++ if (!rc)
++ rc = PyObject_IsInstance((PyObject*)b,
++ (PyObject*)&PyLong_Type);
++ if (rc < 0)
+ return NULL;
++ if (rc) {
++ if (PyErr_WarnEx(PyExc_BytesWarning,
++ "Comparison between bytes and int", 1))
++ return NULL;
++ }
+ }
}
result = Py_NotImplemented;
}
if (PyDict_CheckExact(other)) {
while (set_next(so, &pos, &entry)) {
setentry entrycopy;
+ int rv;
entrycopy.hash = entry->hash;
entrycopy.key = entry->key;
- if (!_PyDict_Contains(other, entry->key, entry->hash)) {
+ rv = _PyDict_Contains(other, entry->key, entry->hash);
+ if (rv < 0) {
+ Py_DECREF(result);
+ return NULL;
+ }
+ if (!rv) {
- if (set_add_entry((PySetObject *)result, &entrycopy) == -1) {
+ if (set_add_entry((PySetObject *)result, &entrycopy)) {
Py_DECREF(result);
return NULL;
}