"Kent Johnson" <ken...@tds.net> wrote

Rather than editing the existing code and making it non standard
why not subclass robotparser:

That won't work, it is urllib.URLOpener() that he is patching and

Sorry, yes I misread that post as modifying robotparser, it
should have been URLOpener.

But...

robotparser does not supply a way to change the URLOpener subclass
that it uses.

I didn't realize that. So you would need to cut n' paste the robotparser
read() method into a subclass of robotparser too. Which is almost
as messy as editing the original source. Such a shame that the
author didn't either put the opener as an attribute or as a defaulted
parameter of read!

Pity, I hate to see editing of existing classes in an OO system.

Alan G.

_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to