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

Feat: Add CC2 support #11

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Feat: Add CC2 support #11

wants to merge 1 commit into from

Conversation

Raymo111
Copy link
Member

No description provided.

}


def allowed_product_ids(*product_ids: int):
def allowed_product_ids(*product_ids: (int, str)):
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: Shall we consider product_ids: {int: str}? A dict seems easier to type and use than key-value pairs.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dict dereferencing for decorators was messy, feel free to change it as long as you can make it work

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Were you referring to dereferencing a **kwargs-like dict? I do notice that it currently also uses a *args-like sequence. I would personally prefer to use only one parameter which is a container. Such as:

Suggested change
def allowed_product_ids(*product_ids: (int, str)):
def allowed_product_ids(product_ids: {int, str}):

and then it would be used like this:

@allowed_product_ids({
    0x8189: "S2",
    0x818A: "S2 - UF2 Bootloader",
})
class CharaChorderEngine(CharaChorder):

... as long as you can make it work

Admittedly, I haven't tested it in this code base (don't know how), but the usage above should work.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We shouldn't be messing with any of this IMO. Will get to it once I have the time for a review

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

Successfully merging this pull request may close these issues.

3 participants