Message338354
| 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:50 | bux | set | recipients: + bux |
| 2019-03-19 13:29:50 | bux | set | messageid: <1553002190.66.0.121651684689.issue36363@roundup.psfhosted.org> |
| 2019-03-19 13:29:50 | bux | link | issue36363 messages |
| 2019-03-19 13:29:50 | bux | create | |