Commit f6ed7c0
authored
`IO` is purported to be the type of the file objects returned by `open`.
However, all methods on those objects take positional-only arguments, while
`IO`'s methods are declared with regular arguments. As such, the file objects
cannot actually be considered to implement `IO`. The same thing applies to
`BinaryIO`.
Fix this by adjusting the definition of these ABCs to match the file objects.
This is technically a breaking change, but it is unlikely to actually break
anything:
* These methods should never be called at runtime, since they are abstract.
Therefore, this should not cause any runtime errors.
* In typeshed these arguments are already positional-only, so this should
not cause any errors during typechecking either.
1 parent 9a1c70c commit f6ed7c0
File tree
2 files changed
+11
-9
lines changed- Lib
- Misc/NEWS.d/next/Library
2 files changed
+11
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3612 | 3612 | | |
3613 | 3613 | | |
3614 | 3614 | | |
3615 | | - | |
| 3615 | + | |
3616 | 3616 | | |
3617 | 3617 | | |
3618 | 3618 | | |
3619 | 3619 | | |
3620 | 3620 | | |
3621 | 3621 | | |
3622 | 3622 | | |
3623 | | - | |
| 3623 | + | |
3624 | 3624 | | |
3625 | 3625 | | |
3626 | 3626 | | |
3627 | | - | |
| 3627 | + | |
3628 | 3628 | | |
3629 | 3629 | | |
3630 | 3630 | | |
3631 | | - | |
| 3631 | + | |
3632 | 3632 | | |
3633 | 3633 | | |
3634 | 3634 | | |
| |||
3640 | 3640 | | |
3641 | 3641 | | |
3642 | 3642 | | |
3643 | | - | |
| 3643 | + | |
3644 | 3644 | | |
3645 | 3645 | | |
3646 | 3646 | | |
3647 | 3647 | | |
3648 | 3648 | | |
3649 | 3649 | | |
3650 | 3650 | | |
3651 | | - | |
| 3651 | + | |
3652 | 3652 | | |
3653 | 3653 | | |
3654 | 3654 | | |
3655 | | - | |
| 3655 | + | |
3656 | 3656 | | |
3657 | 3657 | | |
3658 | 3658 | | |
3659 | 3659 | | |
3660 | 3660 | | |
3661 | 3661 | | |
3662 | 3662 | | |
3663 | | - | |
| 3663 | + | |
3664 | 3664 | | |
3665 | 3665 | | |
3666 | 3666 | | |
| |||
3670 | 3670 | | |
3671 | 3671 | | |
3672 | 3672 | | |
3673 | | - | |
| 3673 | + | |
3674 | 3674 | | |
3675 | 3675 | | |
3676 | 3676 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
0 commit comments