This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author nnorwitz
Date 2006-11-08.05:53:04
SpamBayes Score
Marked as misclassified
Logged In: YES 

tomer, do you know about configuring with --pydebug?  That
helps track down refleaks when running regrtest -R ::.

 _dir_locals: result is not necessary and locals doesn't
need to be initialized as it's set on the next line.  You
could just declare and set it all on one line.

_specialized_dir_type should be static.  No need to init
dict.  Either don't init result or remove else result =
NULL.  I'd prefer removing the else and leaving the init.

_specialized_dir_module should be static.  No need to init
dict.  Can you get the name of the module and use that in
the error msg: PyModule_GetName()?  That would hopefully
provide a nicer error msg.

_generic_dir: No need to init dict.  

+               /* XXX api change: how about falling to
+                  XXX if no __class__ exists? */

Do you mean falling *back*?  Also, we've been using
XXX(username): as the format for such comments.  So this
would be better as:

 /* XXX(tomer): Perhaps fall back to obj->ob_type if no
__class__ exists? */

_dir_object: No need to init dirfunc.  

PyObject_Dir: No need to init result.

Are there tests for all conditions?  At least:
 * dir()
 * dir(obj)
 * dir(obj_with_no_dict)
 * dir(obj_with_no__class__)
 * dir(obj_with__methods__)
 * dir(obj_with__members__)
 * dir(module)
 * dir(module_with_no__dict__)
 * dir(module_with_invalid__dict__)

There also need to be updates to Doc/lib/libfuncs.tex.  If
you can't deal with the markup, just do the best you can in
text and someone else will fixup the markup.

Thanks for attaching the patch as a single file, it's easier
to deal with.
Date User Action Args
2007-08-23 15:55:15adminlinkissue1591665 messages
2007-08-23 15:55:15admincreate