[Python-Dev] PyObject_REPR() (original) (raw)

Raymond Hettinger raymond.hettinger at verizon.net
Wed Apr 12 01:37:10 CEST 2006


I may not be right, but I don't see how this can't help but not free the intermediate PyString object.

Good catch.

It doesn't seem to be used, except for in situations where Python is not going to continue working much longer anyway (specifically, in compile.c and ceval.c.)

Those internal uses ought to be replaced with better code.

It strikes me that it should not be used, or maybe renamed to PyObjectREPR. It's wasn't added in 2.5 or 2.4, though, so it's not particularly new and I can't guarantee that it's not used in any third party code. But, then again, anyone using it isn't free of leaks. Should removing or renaming it be done in 2.5 or in Py3K?

Since it is intrinsically buggy, I would support removal in Py2.5

Raymond



More information about the Python-Dev mailing list