Message313004
Thank you, Chris, for your reply. If this is indeed the main use case of ModuleNotFoundError, I respectfully suggest to document it better. The way things are now, Python users who switch to 3.6 encounter this new exception during their work with the interpreter and invariably wonder "Should I change anything in my code because of this? If not, why was it introduced?". In my opinion the current documentation does not answer these questions well. Note that this is not about some deeply buried detail. Every Python programmer is bound to encounter this.
That said, I cannot imagine many cases where user code would like to fall back to html.parser only if fancy_parser is not installed but not if an older version of fancy_parser is installed (or maybe it's an entirely *different* fancy_parser?). And in the rare cases where that is desired, it was already perfectly idiomatic to do so:
try:
import fancy_parser
except ImportError:
from html.parser import HTMLParser
else:
from fancy_parser import NewParser as HTMLParser |
|
Date |
User |
Action |
Args |
2018-02-27 13:13:41 | cwg | set | recipients:
+ cwg, gvanrossum, barry, brett.cannon, theller, jcea, pitrou, ezio.melotti, Arfrever, cvrebert, asvetlov, chris.jerdonek, python-dev, eric.snow, serhiy.storchaka, Guido.van.Rossum |
2018-02-27 13:13:41 | cwg | set | messageid: <1519737221.33.0.467229070634.issue15767@psf.upfronthosting.co.za> |
2018-02-27 13:13:41 | cwg | link | issue15767 messages |
2018-02-27 13:13:41 | cwg | create | |
|