mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
* classobject.[ch], {float,long,int}object.c, bltinmodule.c:
coercion is now completely generic. * ceval.c: for instances, don't coerce for + and *; * reverses arguments if left one is non-instance numeric and right one sequence.
This commit is contained in:
parent
70d7a310a9
commit
e6eefc2231
7 changed files with 123 additions and 93 deletions
|
@ -43,5 +43,4 @@ extern object *newinstancemethodobject PROTO((object *, object *));
|
|||
extern object *instancemethodgetfunc PROTO((object *));
|
||||
extern object *instancemethodgetself PROTO((object *));
|
||||
|
||||
extern int instance_coerce PROTO((object **, object **));
|
||||
extern object *instance_convert PROTO((object *, char *));
|
||||
|
|
|
@ -142,6 +142,7 @@ typedef struct {
|
|||
object *(*nb_and) FPROTO((object *, object *));
|
||||
object *(*nb_xor) FPROTO((object *, object *));
|
||||
object *(*nb_or) FPROTO((object *, object *));
|
||||
int (*nb_coerce) FPROTO((object **, object **));
|
||||
} number_methods;
|
||||
|
||||
typedef struct {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue