List objects are un-hashable

Andy andy.rockford at gmail.com
Fri Apr 27 04:23:37 EDT 2007


> What you want is something like:
>
>  for line in inp:
>      lines +=1
>      # a list of words
>      tempwords = line.split()
>      for k in tempwords:
>          if keyword.iskeyword(k):
>             print tempwords


I think it should be:

     if keyword.iskeyword(k):
          print k




More information about the Python-list mailing list