-
Notifications
You must be signed in to change notification settings - Fork 722
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
Allow worlds to add options to prebuilt groups #3509
Allow worlds to add options to prebuilt groups #3509
Conversation
Previously, this crashed because `typing.NamedTuple` fields such as `group.name` aren't assignable. Now it will only fail for group names that are actually incorrectly cased, and will fail with a better error message.
@@ -123,8 +123,8 @@ def __new__(mcs, name: str, bases: Tuple[type, ...], dct: Dict[str, Any]) -> Web | |||
assert group.options, "A custom defined Option Group must contain at least one Option." | |||
# catch incorrectly titled versions of the prebuilt groups so they don't create extra groups | |||
title_name = group.name.title() | |||
if title_name in prebuilt_options: | |||
group.name = title_name | |||
assert title_name not in prebuilt_options or title_name == group.name, \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i'm fine with the assert title_name == group.name
since i was on the fence about whether that should exist but the other bool here is wrong and the if immediately after this will now not be hit ever.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i thought that was an and, not an or 🤦
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change is fine, i made an oopsy and forgot that NamedTuple is immutable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM and this fixed the behavior
Previously, this crashed because `typing.NamedTuple` fields such as `group.name` aren't assignable. Now it will only fail for group names that are actually incorrectly cased, and will fail with a better error message.
Previously, this crashed because `typing.NamedTuple` fields such as `group.name` aren't assignable. Now it will only fail for group names that are actually incorrectly cased, and will fail with a better error message.
Previously, this crashed because `typing.NamedTuple` fields such as `group.name` aren't assignable. Now it will only fail for group names that are actually incorrectly cased, and will fail with a better error message.
Previously, this crashed because `typing.NamedTuple` fields such as `group.name` aren't assignable. Now it will only fail for group names that are actually incorrectly cased, and will fail with a better error message.
What is this fixing or adding?
Previously, this crashed because
typing.NamedTuple
fields such asgroup.name
aren't assignable. Now it will only fail for group namesthat are actually incorrectly cased, and will fail with a better error
message.
How was this tested?
I updated the DS3 beta to add options to a prebuilt group.