Closed RossK1 closed 6 months ago
Should be good to resolve #22 . There is a bit of a workaround in the typing of arguments to the builtin "open" method. This should be of type FileDescriptorOrPath from the _typeshed package. This package is in the stdlib, but not in older versions of Python. As such, a type alias for it was defined and used instead. Once circuitpython only supports versions of python that include _typeshed, then it can be switched over as indicated in the code comments.
Mostly addition of type annotations, but one commit to fix a suspected bug. The open function was trying to add an attribute to the file_name variable. This variable was also later never used. Above in the code, the same pattern is used to set the variable on the file_state dictionary instead, which is used. So I presume this was the intended code here too.