swsnu / swppfall2019

31 stars 22 forks source link

[HW1] about decorator arguments #27

Open tho-kn opened 5 years ago

tho-kn commented 5 years ago

You can assume that the filename argument is the first argument for the function to decorate.

in specification, the first argument could be assumed to be a filename. However initializer's first argument is "self", so exception occurs when I use it as filename.

Is it ok to assume that 2nd argument is filename?

hy00nc commented 5 years ago

The first argument here means the first one after the self, since self should be there by default in python. So you will have to put additional argument after self, which you called it as '2nd' one :)