@@ -1138,7 +1138,7 @@ func TypeNew(metatype *Type, args Tuple, kwargs StringDict) Object {
1138
1138
if winner != metatype {
1139
1139
//if winner.New != TypeNew { // Pass it to the winner
1140
1140
// FIXME Nasty hack since you can't compare function pointers in Go
1141
- if fmt .Sprintf ("%x " , winner .New ) != fmt .Sprintf ("%x " , TypeNew ) { // Pass it to the winner
1141
+ if fmt .Sprintf ("%p " , winner .New ) != fmt .Sprintf ("%p " , TypeNew ) { // Pass it to the winner
1142
1142
return winner .New (winner , args , kwargs )
1143
1143
}
1144
1144
metatype = winner
@@ -1504,7 +1504,7 @@ func excess_args(args Tuple, kwargs StringDict) bool {
1504
1504
func ObjectInit (self Object , args Tuple , kwargs StringDict ) {
1505
1505
t := self .Type ()
1506
1506
// FIXME bodge to compare function pointers
1507
- if excess_args (args , kwargs ) && (fmt .Sprintf ("%x " , t .New ) == fmt .Sprintf ("%x " , ObjectNew ) || fmt .Sprintf ("%x " , t .Init ) != fmt .Sprintf ("%x " , ObjectInit )) {
1507
+ if excess_args (args , kwargs ) && (fmt .Sprintf ("%p " , t .New ) == fmt .Sprintf ("%p " , ObjectNew ) || fmt .Sprintf ("%p " , t .Init ) != fmt .Sprintf ("%p " , ObjectInit )) {
1508
1508
panic (ExceptionNewf (TypeError , "object.__init__() takes no parameters" ))
1509
1509
}
1510
1510
// Call the __init__ method if it exists
@@ -1524,7 +1524,7 @@ func ObjectInit(self Object, args Tuple, kwargs StringDict) {
1524
1524
1525
1525
func ObjectNew (t * Type , args Tuple , kwargs StringDict ) Object {
1526
1526
// FIXME bodge to compare function pointers
1527
- if excess_args (args , kwargs ) && (fmt .Sprintf ("%x " , t .Init ) == fmt .Sprintf ("%x " , ObjectInit ) || fmt .Sprintf ("%x " , t .New ) != fmt .Sprintf ("%x " , ObjectNew )) {
1527
+ if excess_args (args , kwargs ) && (fmt .Sprintf ("%p " , t .Init ) == fmt .Sprintf ("%p " , ObjectInit ) || fmt .Sprintf ("%p " , t .New ) != fmt .Sprintf ("%p " , ObjectNew )) {
1528
1528
panic (ExceptionNewf (TypeError , "object() takes no parameters" ))
1529
1529
}
1530
1530
0 commit comments