Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

InStream.logging_file_path setter type hint is not effective #613

Open
bkeryan opened this issue Jul 10, 2024 · 0 comments
Open

InStream.logging_file_path setter type hint is not effective #613

bkeryan opened this issue Jul 10, 2024 · 0 comments

Comments

@bkeryan
Copy link
Collaborator

bkeryan commented Jul 10, 2024

logging_file_path currently has the following type hints, because we wanted to allow setting it using either a pathlib.Path or a str:

    @property
    def logging_file_path(self) -> Optional[pathlib.Path]: ...

    @logging_file_path.setter
    def logging_file_path(self, val: Optional[Union[str, pathlib.PurePath]]): ...

    @logging_file_path.deleter
    def logging_file_path(self): ...

However, we were previously running mypy separately for the nidaqmx package and its tests. Combining these runs revealed that mypy doesn't honor the setter's type hint:

tests\component\task\test_in_stream_read_properties.py:139: error: Incompatible types in assignment (expression has type "str", variable has type "Optional[Path]")  [assignment]
tests\component\task\test_in_stream_read_properties.py:159: error: Incompatible types in assignment (expression has type "str", variable has type "Optional[Path]")  [assignment]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant