Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3868 from luigibertaco/from_future_annotations_as
bugfix: accepts aliases for __future__ annotations
- Loading branch information
Showing
5 changed files
with
37 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
tests/functional/p/postponed_evaluation_activated_with_alias.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# pylint: disable=missing-docstring,no-self-use,unused-argument,pointless-statement | ||
# pylint: disable=too-few-public-methods,no-name-in-module | ||
from __future__ import annotations as __annotations__ | ||
|
||
|
||
class MyClass: | ||
@classmethod | ||
def from_string(cls, source) -> MyClass: | ||
... | ||
|
||
def validate_b(self, obj: OtherClass) -> bool: | ||
... | ||
|
||
|
||
class OtherClass: | ||
... | ||
|
||
|
||
class Example: | ||
obj: Other | ||
|
||
|
||
class Other: | ||
... | ||
|
||
|
||
class ExampleSelf: | ||
next: ExampleSelf |
2 changes: 2 additions & 0 deletions
2
tests/functional/p/postponed_evaluation_activated_with_alias.rc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[testoptions] | ||
min_pyver=3.7 |