Annotations can contain forward references even if they are not a string anymore

Since Python 3.7 this behavior can be imported with from future import __annotations
This commit is contained in:
Dave Halter committed 2018-07-28 16:35:24 +02:00
1 parent b073b05aa0
commit 9bba91628a
4 files changed
+28 -5

No files matched your search

+1 -1
View File
@@ -216,5 +216,5 @@ class ModuleContext(TreeContext):
return "<%s: %s@%s-%s is_stub=%s>" % (
self.__class__.__name__, self._string_name,
self.tree_node.start_pos[0], self.tree_node.end_pos[0],
self._path.endswith('.pyi')
self._path is not None and self._path.endswith('.pyi')
)