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

Why is Condition a metaclass? #41

Open
sbellem opened this issue Nov 10, 2016 · 1 comment
Open

Why is Condition a metaclass? #41

sbellem opened this issue Nov 10, 2016 · 1 comment
Assignees
Labels

Comments

@sbellem
Copy link
Contributor

sbellem commented Nov 10, 2016

On a related note, why not provide an __init__ to Condition?

Such that instead of the following

condition = Condition()
condition.type_id = type_id
condition.bitmask = bitmask
condition.hash = _hash
condition.max_fulfillment_length = max_fulfillment_length

we could simply do:

condition = Condition(
    type_id=self.type_id,
    bitmask=self.bitmask,
    hash=_hash,
    max_fulfillment_length=max_fulfillment_length,
)
@diminator
Copy link
Contributor

Condition is an abstract class and should only be initialized by it's children (practically)

I think the example might be misleading... we could change it

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

No branches or pull requests

2 participants