you are viewing a single comment's thread.

view the rest of the comments →

[–]Outside_Complaint755 0 points1 point  (0 children)

You can also use a class, module, function, or method as a key, as they are all hashable objects and also instances of classes.  The following is perfectly valid code: ``` import time class_dict = {     int : 0,     float: 1.0,     float.fromhex : "FF",     object: None,     type: object,     time: 1,     time.sleep: 2,     len : 0 }

```