Author nnorwitz
Recipients
Date 2006-11-08.05:53:04
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
Logged In: YES 
user_id=33168

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

object.c: 
 _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
obj->ob_type 
+                  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.
History
Date User Action Args
2007-08-23 15:55:15adminlinkissue1591665 messages
2007-08-23 15:55:15admincreate