Options: Assert Not All Option in Options.as_dict (#5039)

* Options: forbid worlds just dumping every single option they don't need

* make the equal proper

---------

Co-authored-by: Exempt-Medic <60412657+Exempt-Medic@users.noreply.github.com>
This commit is contained in:
Aaron Wagener
2025-07-16 11:57:11 -05:00
committed by GitHub
parent 608a38f873
commit 1923d6b1bc

View File

@@ -1315,6 +1315,7 @@ class CommonOptions(metaclass=OptionsMetaProperty):
will be returned as a sorted list.
"""
assert option_names, "options.as_dict() was used without any option names."
assert len(option_names) < len(self.__class__.type_hints), "Specify only options you need."
option_results = {}
for option_name in option_names:
if option_name not in type(self).type_hints: