0

What does the < > bracket mean in python? Like in the following list i printed out...

OrderedDict([(<alert.power_level: 0>, OrderedDict([('alert', <alert.power_level: 0>), ('level', <alert_level.none: 0>), ('list_flags', <list_flags_Bitfield: [<list_flags.First: 0>]>)])), (<alert.too_hot: 1>, OrderedDict([('alert', <alert.too_hot: 1>), ('level', <alert_level.none: 0>), ('list_flags', <list_flags_Bitfield: []>)])), (<alert.too_cold: 2>, OrderedDict([('alert', <alert.too_cold: 2>), ('level', <alert_level.none: 0>), ('list_flags', <list_flags_Bitfield: [<list_flags.Last: 1>]>)]))])

Also how do I get the 'level' value (the one after alert.power_level: 0)

bakalolo
  • 3,153
  • 2
  • 28
  • 54
  • Possible duplicate of [What is the meaning of angle brackets in Python?](https://stackoverflow.com/questions/43118694/what-is-the-meaning-of-angle-brackets-in-python) – Daria Pydorenko Nov 26 '19 at 09:41
  • 4
    It isn't valid Python. Not all data types *can* serialize themselves in an `eval`able way; you just found one of the exceptions. Using angle brackets is a conventional way to make that obvious to the reader when implementing a `__repr__` function. – Charles Duffy Nov 26 '19 at 09:42
  • @DariaPydorenko That question is about its meaning in Cython, not the convention with which it's used in this question. – L3viathan Nov 26 '19 at 09:50

0 Answers0