Message408919
from dataclasses import dataclass, field
@dataclass(order=True, frozen=True)
class Character:
sort_index: int = field(init=False, repr=False)
name: str
job: str
age: int
intelligence: int = 50
def __post_init__(self):
object.__setattr__(self, 'sortindex', self.intelligence)
Description:
using sortindex instead of sort_index gave the following suggestion:
Current:
AttributeError: 'Character' object has no attribute 'sort_index'. Did you mean: 'sortindex'?
Expected:
AttributeError: 'Character' object has no attribute 'sortindex'. Did you mean: 'sort_index'? |
|
Date |
User |
Action |
Args |
2021-12-19 18:15:09 | landonjpginn | set | recipients:
+ landonjpginn |
2021-12-19 18:15:09 | landonjpginn | set | messageid: <1639937709.73.0.49042724739.issue46134@roundup.psfhosted.org> |
2021-12-19 18:15:09 | landonjpginn | link | issue46134 messages |
2021-12-19 18:15:09 | landonjpginn | create | |
|