Mercurial > cpython-lru_cache-weakref
diff Objects/classobject.c @ 1049:2ed511171809 legacy-trunk
Made builtins int(), long(), float(), oct() and hex() more generic.
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Sat, 12 Sep 1992 11:09:23 +0000 |
| parents | 7a11a70f7f44 |
| children | f54e64c8b9b7 |
line wrap: on
line diff
--- a/Objects/classobject.c Fri Sep 11 23:55:51 1992 +0000 +++ b/Objects/classobject.c Sat Sep 12 11:09:23 1992 +0000 @@ -714,6 +714,12 @@ return 0; } +UNARY(instance_int, "__int__") +UNARY(instance_long, "__long__") +UNARY(instance_float, "__float__") +UNARY(instance_oct, "__oct__") +UNARY(instance_hex, "__hex__") + static number_methods instance_as_number = { instance_add, /*nb_add*/ instance_sub, /*nb_subtract*/ @@ -733,6 +739,11 @@ instance_xor, /*nb_xor*/ instance_or, /*nb_or*/ instance_coerce, /*nb_coerce*/ + instance_int, /*nb_int*/ + instance_long, /*nb_long*/ + instance_float, /*nb_float*/ + instance_oct, /*nb_oct*/ + instance_hex, /*nb_hex*/ }; typeobject Instancetype = {
