[Python-porting] HTMLParser in 2to3

Christof Hoeke csad7 at t-online.de
Tue Dec 16 21:58:33 CET 2008


 >> I guess the following should happen:
 >>
 >>        import HTMLParser
 >>        # or
 >>        from HTMLParser import HTMLParser
 >>
 >> should get
 >>
 >>        import html.parser
 >>        # or
 >>        from html.parser import HTMLParser

 > The last should be ``from html import pasrser as HTMLParser``.
 >
 > -Brett

not to want to split hairs but the second example ``from HTMLParser 
import HTMLParser`` actually imports the HTMLParser class and not the 
module so I think my original thinking was right?

thanks
Chris


More information about the Python-porting mailing list