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 upuse Enum for rv type #40
Comments
Autoplectic
referenced this issue
Oct 22, 2013
Merged
fix a number of code smells, as well as a few legit bugs. #39
This comment has been minimized.
This comment has been minimized.
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 |
This comment has been minimized.
This comment has been minimized.
fiatflux
commented
Oct 28, 2013
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. |
This comment has been minimized.
This comment has been minimized.
Addressed in #71. |
chebee7i
closed this
Feb 23, 2015
This comment has been minimized.
This comment has been minimized.
And also in bffa2c6 from a while back. |
Autoplectic commentedOct 22, 2013
use Enum on py3.4+ and the backported enum34 package on all others.
at the moment this would be:
class RV_mode(Enum):
names = 0
indices = 1
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.