Antoine Pitrou wrote:
Constants = make_constants('Constants', 'SOME_CONST OTHER_CONST',
values=range(1, 3))
Again, auto-enumeration is useless since it's trivial to achieve
explicitly.
That doesn't make auto-enumeration "useless". Unnecessary, perhaps, but
not useless.
But even then it's only unnecessary if the number of constants are small
enough that you can see how many there are without counting
(essentially, 4 or fewer). When you have more, it becomes error-prone
and a nuisance to have to count them by hand:
Constants = make_constants(
'Constants',
'ST_MODE ST_INO ST_DEV ST_NLINK ST_UID ST_GID' \
'ST_SIZE ST_ATIME ST_MTIME ST_CTIME',
values=range(10)
)
--
Steven
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com