bpo-39361: Document the removal of tp_print by ammaraskar · Pull Request #18125 · python/cpython
Looks like there are still some remnants of tp_print in test_defaultdict.py:
| # NOTE: We can't use tempfile.[Named]TemporaryFile since this | |
| # code must exercise the tp_print C code, which only gets | |
| # invoked for *real* files. | |
| tfn = tempfile.mktemp() | |
| try: | |
| f = open(tfn, "w+") | |
| try: | |
| print(d1, file=f) | |
| print(d2, file=f) | |
| f.seek(0) | |
| self.assertEqual(f.readline(), repr(d1) + "\n") | |
| self.assertEqual(f.readline(), repr(d2) + "\n") | |
| finally: | |
| f.close() | |
| finally: | |
| os.remove(tfn) |
The tp_print function was removed as part of 346f1a8 but the test exercising that path was never changed. Should changing that be done here as well or a separate issue/PR?