Mercurial > cpython-lru_cache-weakref
comparison Objects/floatobject.c @ 53161:df2638b9bee2 3.0
Merged revisions 71628 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k
................
r71628 | benjamin.peterson | 2009-04-15 16:34:27 -0500 (Wed, 15 Apr 2009) | 11 lines
Merged revisions 71627 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r71627 | benjamin.peterson | 2009-04-15 16:26:36 -0500 (Wed, 15 Apr 2009) | 4 lines
call __float__ on str subclasses #5759
tests by R. David Murray
........
................
| author | Benjamin Peterson <benjamin@python.org> |
|---|---|
| date | Wed, 15 Apr 2009 21:40:50 +0000 |
| parents | 87fbbf22adf3 |
| children | e9edcaf42547 |
comparison
equal
deleted
inserted
replaced
| 53149:e7dbfd023ff5 | 53161:df2638b9bee2 |
|---|---|
| 1531 | 1531 |
| 1532 if (type != &PyFloat_Type) | 1532 if (type != &PyFloat_Type) |
| 1533 return float_subtype_new(type, args, kwds); /* Wimp out */ | 1533 return float_subtype_new(type, args, kwds); /* Wimp out */ |
| 1534 if (!PyArg_ParseTupleAndKeywords(args, kwds, "|O:float", kwlist, &x)) | 1534 if (!PyArg_ParseTupleAndKeywords(args, kwds, "|O:float", kwlist, &x)) |
| 1535 return NULL; | 1535 return NULL; |
| 1536 if (PyUnicode_Check(x)) | 1536 /* If it's a string, but not a string subclass, use |
| 1537 PyFloat_FromString. */ | |
| 1538 if (PyUnicode_CheckExact(x)) | |
| 1537 return PyFloat_FromString(x); | 1539 return PyFloat_FromString(x); |
| 1538 return PyNumber_Float(x); | 1540 return PyNumber_Float(x); |
| 1539 } | 1541 } |
| 1540 | 1542 |
| 1541 /* Wimpy, slow approach to tp_new calls for subtypes of float: | 1543 /* Wimpy, slow approach to tp_new calls for subtypes of float: |
