Optparse buggy?

Fulvio false at pp.jaring.my
Thu Sep 1 23:12:44 CEST 2011


Hello,

I'm on python3.2, trying some experiment with OptionParser but no success

>>> from optparse import OptionParser as parser
>>> parser.add_option('-n','--new', dest='new')                                                                                             
Traceback (most recent call last):                                                                                                          
  File "<stdin>", line 1, in <module>                                                                                                       
  File "/usr/lib/python3.2/optparse.py", line 1001, in add_option                                                                           
    option = self.option_class(*args, **kwargs)                                                                                             
AttributeError: 'str' object has no attribute 'option_class'                                                                                
>>>                                                                                                                                     

Any futher item in the option won't make any better.
-- 
Archlinux on $(uname -a) :P




More information about the Python-list mailing list