facebookincubator / cinder

Cinder is Meta's internal performance-oriented production version of CPython.
https://trycinder.com
Other
3.42k stars 122 forks source link

A test in test_static forgot to import `Optional` #61

Closed LuKuangChen closed 2 years ago

LuKuangChen commented 2 years ago

2021-12-27

This test uses Optional but before importing it from typing.

def test_if_optional_reassign(self):
    codestr = """
    class C: pass
    def testfunc(abc: Optional[C]):
        if abc is not None:
            abc = None
    """
    code = self.compile(codestr, modname="foo")
carljm commented 2 years ago

Fixed in https://github.com/facebookincubator/cinder/commit/bb19ccb00e9cfe842d0481bf99d6175c91c6fd6e