[ty] Todo-types for os.fdopen, NamedTemporaryFile, and Path.open (#20549)
## Summary
This applies the trick that we use for `builtins.open` to similar
functions that have the same problem. The reason is that the problem
would otherwise become even more pronounced once we add understanding of
the implicit type of `self` parameters, because then something like
`(base_path / "test.bin").open("rb")` also leads to a wrong return type
and can result in false positives.
## Test Plan
New Markdown tests
This commit is contained in:
@@ -318,6 +318,9 @@ pub enum KnownModule {
|
||||
TypingExtensions,
|
||||
Typing,
|
||||
Sys,
|
||||
Os,
|
||||
Tempfile,
|
||||
Pathlib,
|
||||
Abc,
|
||||
Dataclasses,
|
||||
Collections,
|
||||
@@ -347,6 +350,9 @@ impl KnownModule {
|
||||
Self::Typeshed => "_typeshed",
|
||||
Self::TypingExtensions => "typing_extensions",
|
||||
Self::Sys => "sys",
|
||||
Self::Os => "os",
|
||||
Self::Tempfile => "tempfile",
|
||||
Self::Pathlib => "pathlib",
|
||||
Self::Abc => "abc",
|
||||
Self::Dataclasses => "dataclasses",
|
||||
Self::Collections => "collections",
|
||||
|
||||
Reference in New Issue
Block a user