nltk/nltk — Issue #94: Chapter 6 bad choice of variable name
Author: alexrudnick
Created: 2012-01-17 06:25:57+00:00
State: open

Which version of the book are you using? Online

Please specify the chapter and section number(s) 6

Please describe any problems in as much detail as possible, and feel free
to suggest fixes.

In the section, Gender Identification the following example:

>>> from nltk.corpus import names
>>> import random
>>> names = ([(name, 'male') for name in names.words('male.txt')] +
... [(name, 'female') for name in names.words('female.txt')])
>>> import random
>>> random.shuffle(names)

While it works, as it is, it might be a better example to use a different
variable name than "names" for the list of male and female names after just
importing a "names" module.

Migrated from http://code.google.com/p/nltk/issues/detail?id=494

earlier comments

StevenBird1 said, at 2009-12-07T01:11:44.000Z:

Thanks for pointing out this problem. Unfortunately there are many references to
"names" that would have to be fixed -- we need to decide if this is feasible for the
reprinting.