Ask Your Question

Support for 3.7 @dataclasses?

asked 2019-04-12 10:26:54 -0600

Ed W gravatar image

updated 2019-04-13 07:34:06 -0600

Python introduced a new decorator "@dataclasses" in 3.7 Any chance in the future you'll support code completion for these? Currently Wing doesn't appear to recognize that valid attributes exist, and that when initializing a new object code completion does not indicate that parameters are required.

from dataclasses import dataclass

class Car:    
    make: str
    model: str
    year: int

car = Car("Datsun", "B210", 1970 )
print (car.make)

Thanks - Ed

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2019-04-14 17:42:44 -0600

Dataclasses will be supported in Wing 7. Attributes are partially supported, though there's a bug that omits them from autocomplete lists. That bug should be fixed soon and support for parameters in the constructor will be added in a future Wing 7 update.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2019-04-12 10:26:54 -0600

Seen: 756 times

Last updated: Apr 14 '19