mirror of
https://github.com/MarioSpore/Grinch-AP.git
synced 2025-10-21 20:21:32 -06:00
SoE: minor typing and style fixes (#2724)
* SoE: fix typing for tests * SoE: explicitly export pyevermizer To support loading the module from source (rather than module) we import pyevermizer from `__init__.py` in other files. This has been an implicit export and `mypy --strict` disables implicit exports, so we export it explicitly now. * SoE: fix style in patch.py * SoE: remove unused imports * SoE: fix format mistakes * SoE: cleaner typing in SoEOptions.flags as suggested by beauxq
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
from dataclasses import dataclass, fields
|
||||
from typing import Any, cast, Dict, Iterator, List, Tuple, Protocol
|
||||
|
||||
from Options import AssembleOptions, Choice, DeathLink, DefaultOnToggle, PerGameCommonOptions, ProgressionBalancing, \
|
||||
Range, Toggle
|
||||
from Options import AssembleOptions, Choice, DeathLink, DefaultOnToggle, Option, PerGameCommonOptions, \
|
||||
ProgressionBalancing, Range, Toggle
|
||||
|
||||
|
||||
# typing boilerplate
|
||||
@@ -294,5 +294,7 @@ class SoEOptions(PerGameCommonOptions):
|
||||
for field in fields(self):
|
||||
option = getattr(self, field.name)
|
||||
if isinstance(option, (EvermizerFlag, EvermizerFlags)):
|
||||
flags += getattr(self, field.name).to_flag()
|
||||
assert isinstance(option, Option)
|
||||
# noinspection PyUnresolvedReferences
|
||||
flags += option.to_flag()
|
||||
return flags
|
||||
|
||||
Reference in New Issue
Block a user