A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2010-March/098203.html below:

[Python-Dev] doctest, unicode repr, and 2to3

[Python-Dev] doctest, unicode repr, and 2to3"Martin v. Löwis" martin at v.loewis.de
Fri Mar 5 22:39:30 CET 2010
> The issue shows (yet again) a general problem with doctests being
> overspecified -- the test shouldn't care that the output starts with
> 'u', it should only care that the value is unicode, but there's no
> easy way to express this in doctests. But since these doctests exist I
> suggest that the practical way forward is to stick with them rather
> than trying to reformulate all the tests.

Ok, I think I would prefer that. One approach I considered was to
override sys.displayhook, so that I can determine what parts of the
output are "single" repr results. Of course, this wouldn't catch repr
strings that were ultimately print()ed (not sure whether that
restriction would affect Django).

The other (more aggressive) approach is the heuristics you propose,
which may end up with false negatives. doctest already has a wildcard
matching flag, so it would grow another one.

Regards,
Martin

More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4