You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
class test:
@kwargs
def __init__(self, a=100, b=200, c=300):
print(a, b, c)
will compile into:
function test(a, b, c){
var self = this;
if (typeof a === "undefined") a = 100;
if (typeof b === "undefined") b = 200;
if (typeof c === "undefined") c = 300;
_$rapyd$_print(a, b, c);
};
test.prototype.__init__ = kwargs(test.prototype.__init__);
Since init doesn't exist, it will break. I'd need to test this further to see if a passthrough of regular constructor through kwargs would work or would introduce other problems with isinstance() and inheritance.
The text was updated successfully, but these errors were encountered:
The following code:
will compile into:
Since init doesn't exist, it will break. I'd need to test this further to see if a passthrough of regular constructor through kwargs would work or would introduce other problems with isinstance() and inheritance.
The text was updated successfully, but these errors were encountered: