@@ -1138,7 +1138,7 @@ func TypeNew(metatype *Type, args Tuple, kwargs StringDict) Object{
11381138if winner != metatype {
11391139//if winner.New != TypeNew{// Pass it to the winner
11401140// 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
11421142return winner .New (winner , args , kwargs )
11431143 }
11441144metatype = winner
@@ -1504,7 +1504,7 @@ func excess_args(args Tuple, kwargs StringDict) bool{
15041504func ObjectInit (self Object , args Tuple , kwargs StringDict ){
15051505t := self .Type ()
15061506// 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 )){
15081508panic (ExceptionNewf (TypeError , "object.__init__() takes no parameters" ))
15091509 }
15101510// Call the __init__ method if it exists
@@ -1524,7 +1524,7 @@ func ObjectInit(self Object, args Tuple, kwargs StringDict){
15241524
15251525func ObjectNew (t * Type , args Tuple , kwargs StringDict ) Object {
15261526// 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 )){
15281528panic (ExceptionNewf (TypeError , "object() takes no parameters" ))
15291529 }
15301530
0 commit comments