New submission from Batuhan Taskaya <isidenti...@gmail.com>:

While I was working on making 'future annotations' default, I noticed that 
dataclasses acts differently under the annotation feature. One example would be 
the file [signature.py]:

[ without future import]
 $ python t.py
X(a: int, b: int)
[ with future import]
 $ python t.py
X(a: '_type_a', b: '_type_b') -> '_return_type'

This is causing too much test to fail,
AssertionError: '_return_type' is not None

- C(x:'_type_x')->'_return_type'
+ C(x:collections.deque)

- C(x:'_type_x'=<factory>)->'_return_type'
+ C(x:collections.deque=<factory>)

- C(x:'_type_x')->'_return_type'
+ C(x:List[int])

(and more)

----------
files: script.py
messages: 370073
nosy: BTaskaya, eric.smith
priority: normal
severity: normal
status: open
title: dataclass signatures and docstrings w/future-annotations
Added file: https://bugs.python.org/file49195/script.py

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue40794>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to