Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

funcs_kwargs doesn't update class signature when inheriting from Module #15

Closed
lgvaz opened this issue Mar 15, 2020 · 1 comment
Closed

Comments

@lgvaz
Copy link
Contributor

lgvaz commented Mar 15, 2020

Using funcs_kwargs with a class that inherits from Module does not update the class signature.

Minimum example:

from fastai2.basics import *

@funcs_kwargs
class C(Module):
  _methods = ['m1']
  def __init__(self, **kwargs): pass
  def m1(self): return 1

print(inspect.signature(C))

Returns: (self, **kwargs)
Expected: (*, m1=None)

@sgugger
Copy link
Contributor

sgugger commented Mar 18, 2020

Thanks for flagging! Should be fixed now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants