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

Refactor - combine init and calculate #276

Open
ethanstrominger opened this issue Nov 13, 2024 · 0 comments
Open

Refactor - combine init and calculate #276

ethanstrominger opened this issue Nov 13, 2024 · 0 comments

Comments

@ethanstrominger
Copy link
Collaborator

home=Home(args)   # does some calculations
home.calculate() # does some calculations

to

home=Home.calculate(args)

Here is code for the beginning of Home.calculate:

    @classmethod
    def calculate(cls, *args):
        # Create an instance directly using __new__
        instance = cls.__new__(cls)
        -- code from __init__
       -- code from calculate
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

1 participant