Skip to content

Solve type issues#517

Merged
andfoy merged 1 commit intoandfoy:mainfrom
XY0797:main
Aug 12, 2025
Merged

Solve type issues#517
andfoy merged 1 commit intoandfoy:mainfrom
XY0797:main

Conversation

@XY0797
Copy link
Contributor

@XY0797 XY0797 commented Jul 24, 2025

As mentioned in #377, the Python binding corresponding to Rust's OsString type is <class 'str'>.

In winpty/winpty.pyi, the parameters for PTY.spawn, the return values of PTY.read/read_stderr, and the parameters for PTY.write are incorrectly annotated as bytes, when they should actually be str.

While these incorrect type annotations were less problematic in the past, modern AI-powered IDEs rely heavily on Python's type system. Erroneous type hints can directly cause AI assistants to generate incorrect code.

To address this, I enabled Pylance's type checking (Standard mode) and manually resolved all type-related errors and warnings.

Since I'm not a native English speaker, please forgive any awkward phrasing in my edits and feel free to revise them.

@andfoy
Copy link
Owner

andfoy commented Aug 12, 2025

Thanks @XY0797! Could you please rebase this PR in order to fix the merge conflicts?

@andfoy andfoy merged commit f4a64ac into andfoy:main Aug 12, 2025
6 checks passed
@andfoy andfoy added this to the v3.0.0 milestone Aug 12, 2025
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

Successfully merging this pull request may close these issues.

2 participants