Opened 9 years ago

Last modified 8 years ago

#6523 task new

— at Constants HOWTO doesn’t document that constants are ordered.Initial Version

Reported by: Wilfredo Sánchez Vega Owned by:
Priority: normal Milestone:
Component: core Keywords:
Cc: Glyph, Wilfredo Sánchez Vega Branch:
Author:

Description

The ordered and comparable behavior of constants would be useful to document:

>>> from twisted.python.constants import NamedConstant, Names
>>> class Letters(Names):
...   a = NamedConstant()
...   b = NamedConstant()
...   c = NamedConstant()
... 
>>> Letters.a < Letters.b < Letters.c
True
>>> Letters.a > Letters.b 
False
>>> Letters.c < Letters.b < Letters.a
False
>>> Letters.c > Letters.b 
True
>>> 

Change History (0)

Note: See TracTickets for help on using tickets.