tdryer / hangups

the first third-party instant messaging client for Google Hangouts
https://hangups.readthedocs.io/
MIT License
1.71k stars 189 forks source link

Remove staticmethod decorator from CredentailsPrompt methods #523

Closed cdce8p closed 2 years ago

cdce8p commented 2 years ago

I would like to suggest the removal of the @staticmethod decorators for CredentialPrompt methods.

The CredentialsPrompt.get_* methods aren't really staticmethods, they just don't use self. Each invocation happens from an existing instance with credentials_prompt.get_*.

Furthermore, it's reasonable to subclass CredentialsPrompt and then provide email, pwd, and credentials in __init__. Doing so with the @staticmethod decorator is still possible, but with the next pylint release 2.13 it will be an error as technically it's a different function signature. An example from Home Assistant: hangouts/hangups_utils.py#L10-L70.

In theory this could be a breaking change for someone who relies on calling these with CredentialsPrompt.get_*, I'm not familiar enough with the library to know if that's a real problem.

tdryer commented 2 years ago

Thanks!