Author Ricyteach
Recipients Ricyteach, eric.smith
Date 2018-05-09.21:38:42
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1525901922.71.0.682650639539.issue33453@psf.upfronthosting.co.za>
In-reply-to
Content
This is broken in 3.7 (both beta 3 and 4):

from __future__ import annotations
from dataclasses import dataclass
from typing import ClassVar, Any

@dataclass
class C():
    class_var: ClassVar[Any] = object()
    data: str

Traceback:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\ricky\AppData\Local\Programs\Python\Python37\lib\dataclasses.py", line 850, in dataclass
    return wrap(_cls)
  File "C:\Users\ricky\AppData\Local\Programs\Python\Python37\lib\dataclasses.py", line 842, in wrap
    return _process_class(cls, init, repr, eq, order, unsafe_hash, frozen)
  File "C:\Users\ricky\AppData\Local\Programs\Python\Python37\lib\dataclasses.py", line 763, in _process_class
    else 'self',
  File "C:\Users\ricky\AppData\Local\Programs\Python\Python37\lib\dataclasses.py", line 442, in _init_fn
    raise TypeError(f'non-default argument {f.name!r} '
TypeError: non-default argument 'data' follows default argument
History
Date User Action Args
2018-05-09 21:38:42Ricyteachsetrecipients: + Ricyteach, eric.smith
2018-05-09 21:38:42Ricyteachsetmessageid: <1525901922.71.0.682650639539.issue33453@psf.upfronthosting.co.za>
2018-05-09 21:38:42Ricyteachlinkissue33453 messages
2018-05-09 21:38:42Ricyteachcreate