Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: Creating a set with dataclass and dict
Post: RE: Creating a set with dataclass and dict

Ok I finally understand. The hashable test got me here, I was too confident in his result. I didn't check the documentation about it. So the response is that a set need a Hashable object, and an obje...
hobbitdur General Coding Help 11 9,653 Jan-16-2020, 11:17 AM
    Thread: Creating a set with dataclass and dict
Post: RE: Creating a set with dataclass and dict

(Jan-16-2020, 09:49 AM)buran Wrote: (Jan-16-2020, 09:42 AM)hobbitdur Wrote: And my class Building is Hashable.No, it's not hashable, because one of the fields is dict, which is mutable and not has...
hobbitdur General Coding Help 11 9,653 Jan-16-2020, 10:04 AM
    Thread: Creating a set with dataclass and dict
Post: RE: Creating a set with dataclass and dict

Thank you for the explanation ! You helped me a lot. I agree NamedTuple is useful here. But what I don't understand is the following sentence from the doc: A set object is an unordered collection of d...
hobbitdur General Coding Help 11 9,653 Jan-16-2020, 09:42 AM
    Thread: Creating a set with dataclass and dict
Post: RE: Creating a set with dataclass and dict

micseydel, thank you for your kind help. But I am not sure I understood your answer. You speak about using set in set or dict key. That's not what I meant. My problem is the line 11 of my code. I have...
hobbitdur General Coding Help 11 9,653 Jan-16-2020, 08:36 AM
    Thread: Creating a set with dataclass and dict
Post: Creating a set with dataclass and dict

Hi everyone. I am trying to play with the new @dataclass and TypedDict from 3.7 and 3.8 But after searching and reading lots of documentation I cannot find a proper answer on this. I think the answer ...
hobbitdur General Coding Help 11 9,653 Jan-15-2020, 05:06 PM

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020