Re: [Python-Dev] PEP 435 -- Adding an Enum type to the Python standard library

On 04/20/2013 01:42 PM, Barry Warsaw wrote:> On Apr 13, 2013, at 12:51 PM, Steven D'Aprano wrote:
Composite keys have been part of relational databases from their inception. If you want to store an enumeration value in a database when non-unique values are possible, you can do so simply by storing the name, value pair; i.e. use two columns instead of one. Of course this does not preclude storing just the value when you know they will be unique. But it is not true that unique values are *required* for storing enumeration values in a database.

On 04/20/2013 10:55 PM, Rurpy wrote:
I should have added that allowing mixed types for values (e.g. as discussed in http://mail.python.org/pipermail/python-dev/2013-April/125322.html) is far more problematic for database storage than non-unique values are. Nearly all databases (Sqlite being an exception) don't allow different types in a column. (Not sure if mixed types is still an open issue or not...)

On 04/20/2013 10:55 PM, Rurpy wrote:
I should have added that allowing mixed types for values (e.g. as discussed in http://mail.python.org/pipermail/python-dev/2013-April/125322.html) is far more problematic for database storage than non-unique values are. Nearly all databases (Sqlite being an exception) don't allow different types in a column. (Not sure if mixed types is still an open issue or not...)
participants (1)
-
Rurpy