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

Many @classmethod in templates that don't use cls #22

Closed
hhoeflin opened this issue May 24, 2021 · 1 comment
Closed

Many @classmethod in templates that don't use cls #22

hhoeflin opened this issue May 24, 2021 · 1 comment

Comments

@hhoeflin
Copy link

Hi,

in your templates in
https://github.com/plotly/dash-labs/blob/main/dash_labs/templates/base.py
you have many classmethods that don't use "cls" at all. I suggest that you turn them into staticmethods or make them pure functions.

@jonmmease
Copy link
Contributor

Hi @hhoeflin, thanks for taking a look.

The reason I ended up making them class methods was so that template subclasses can selectively override the component constructor methods. If I recall correctly, this isn't possible with static methods.

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

3 participants