We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3b6cfa0 commit cb87828Copy full SHA for cb87828
schemascii/data.py
@@ -56,9 +56,11 @@ class Data:
56
@classmethod
57
def define_option(cls, ns: str, opt: _dc.Option):
58
if ns in cls.allowed_options:
59
- if any(eo.name == opt.name for eo in cls.allowed_options[ns]):
+ if any(eo.name == opt.name and eo != opt
60
+ for eo in cls.allowed_options[ns]):
61
raise ValueError(f"duplicate option name {opt.name!r}")
- cls.allowed_options[ns].append(opt)
62
+ if opt not in cls.allowed_options[ns]:
63
+ cls.allowed_options[ns].append(opt)
64
else:
65
cls.allowed_options[ns] = [opt]
66
0 commit comments