Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
use Enum for rv type #40
use Enum on py3.4+ and the backported enum34 package on all others.
at the moment this would be:
and each dist would grow a type which is one of these enums. Information measures would look at this property to know how to do things.
referenced this issue
Oct 22, 2013
So I'm definitely +1 on distributions storing a default value for this mode that is changed when rv names are assigned. The thing I'm +0 on is whether to use Enum or not. Its certainly conceptually clearer, but I find option A below easier for users to type and understand.
Either option is a big improvement over the current boolean
In most languages I'd be 100% for enum over a string label, so that problems can be caught early. But in Python typos will cause hairy runtime issues either way. So the only other consideration I can think of is high performance, which the very language is not.
tl;dr: I like string labels.