treyhunner / names

Random name generator
MIT License
462 stars 107 forks source link

Adapted get_first_name to be explicit about what gender value required #6

Closed svisser closed 10 years ago

svisser commented 10 years ago

It seems wrong that names.get_first_name(gender="other") now randomly selects a "male" or "female" gender value without telling the developer. Given the discussions about gender in tech I think it's better to be explicit about passing in "male" or "female" and only selecting a random value when gender equals None.

To view this differently: as there currently are only male and female lists of names, it's better to let those who use the names package decide rather than letting the names package accept seemingly arbitrary gender values.

coveralls commented 10 years ago

Coverage Status

Coverage decreased (-3.23%) when pulling de4d72645fb630de21503e1d983f6d803b5f1c78 on svisser:patch-2 into d700d5d0df598ee6a548b0511ad6882268dd5fc3 on treyhunner:master.

treyhunner commented 10 years ago

Raising an exception when passing in an unrecognized value does seem more appropriate. Thanks again!