Closed fsimkovic closed 6 years ago
The enum34 package is now distributed with CCP4. We should exchange previously converted objects back to enum34 data objects to be more consistent with how we store/access them and also comply with Python3.4 conventions.
enum34
A basic example would be the following:
class LogColors(object): """Color container for log messages""" CRITICAL = 31 DEBUG = 34 DEFAULT = 0 ERROR = 31 WARNING = 33
This would be converted to
from enum34 import Enum class LogColors(Enum): """Color container for log messages""" critical = 31 debug = 34 default = 0 error = 31 warning = 33
Previously, we would access data using normal dict conventions, now
dict
>>> LogColors['critical'].name CRITICAL >>> LogColors['critical'].value 31 >>> LogColors(31) <LogColors.critical: 31>
What are your thoughts on this @hlasimpk?
The
enum34
package is now distributed with CCP4. We should exchange previously converted objects back toenum34
data objects to be more consistent with how we store/access them and also comply with Python3.4 conventions.A basic example would be the following:
This would be converted to
Previously, we would access data using normal
dict
conventions, nowWhat are your thoughts on this @hlasimpk?