Closed arjun-kg closed 1 year ago
minigrid/core
I had some trouble with pyright, there was a particular case which I wasn't sure how to deal with,
suppose,
def func(x: Optional[int] = None): if x is None: x = 3 ... y = x + 5 # pyright has a problem with this saying None type does not support addition
My solution was to add a assert x is not None above where the problem occurs to fix this, I might be missing a simpler fix.
assert x is not None
pre-commit
pre-commit run --all-files
CONTRIBUTING.md
Description
minigrid/core
.I had some trouble with pyright, there was a particular case which I wasn't sure how to deal with,
suppose,
My solution was to add a
assert x is not None
above where the problem occurs to fix this, I might be missing a simpler fix.Type of change
Checklist:
pre-commit
checks withpre-commit run --all-files
(seeCONTRIBUTING.md
instructions to set it up)