2017-07-04 12:52 GMT+02:00 Nick Coghlan <ncogh...@gmail.com>: > I know it's longer, but perhaps it would make sense to put the > bisection helper under "python -m test.support.bisect" in both Python > 2 & 3?
For me, test.support is a toolkit to *write* tests, not really to run tests. I don't really care where my bisect tool lives. Serhiy proposed test.bisect, I like because it's short and easy to remind. Technically it is possible to get test.bisect on Python 2, it just requires to modify 4 .py files which import Lib/bisect.py to add "from __future__ import absolute_import": Lib/urllib2.py:import bisect Lib/mhlib.py:from bisect import bisect Lib/test/test_bisect.py:import bisect as py_bisect Lib/multiprocessing/heap.py:import bisect I modified Lib/test/test_bisect.py, but I missed these other ones in my first commit. And then I got a failure in multiprocessing. I chose the conservative approach: rename the new Lib/test/bisect.py file. Do you prefer to get test.bisect, and so modify the 4 files to add "from __future__ import absolute_import"? I didn't recall the subtle details of "relative import" in Python 2. Since I'm now used to Python 3, the Python 2 behaviour now really looks weird to me :-) Victor _______________________________________________ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com