This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author bux
Recipients bux
Date 2019-03-19.13:29:50
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1553002190.66.0.121651684689.issue36363@roundup.psfhosted.org>
In-reply-to
Content
Hello,

For following code:

```
import dataclasses
import typing
from datetime import datetime


@dataclasses.dataclass
class Foo:
    datetime: typing.Optional[datetime] = None


print(dataclasses.fields(Foo)[0].type)
```

`datetime` `Foo` attribute have `NoneType` type. Problem come from `datetime` attribute name is already used by the `from datetime import datetime` import. I'm not sure if it is a bug or a strange behavior but it seems not regular. Tested on python 3.8.0a2 with same result.
History
Date User Action Args
2019-03-19 13:29:50buxsetrecipients: + bux
2019-03-19 13:29:50buxsetmessageid: <1553002190.66.0.121651684689.issue36363@roundup.psfhosted.org>
2019-03-19 13:29:50buxlinkissue36363 messages
2019-03-19 13:29:50buxcreate