Alexander Belopolsky <belopol...@users.sourceforge.net> added the comment:
On Wed, Nov 4, 2009 at 9:46 AM, Nick Coghlan <rep...@bugs.python.org> wrote: > > Nick Coghlan <ncogh...@gmail.com> added the comment: > > If the idea is to create the "one obvious way" for interning, calling > the method and corresponding C function "intern" isn't painting a > bikeshed, it's meeting the design spec :) > Any bikeshed needs to be painted and _PySet_Add was deliberately just a primer. (Sorry for the cliche abuse.) At the C API level, I was hoping that old PySet_Add semantics could be eventually deprecated and _PySet_Add be promoted to a public method. Keeping two functions that have the same effect but return different values is inelegant especially given that zero return from one is success and from the other is an error, so people who don't pay attention to compiler warnings may get some nasty bugs. Maybe _PySet_Add should be renamed to _PySet_AddAndReturn to emphasize the similarity and difference with PySet_Add. I don't mind calling the method _PySet_Intern (in the original patch I used _PySet_InternString), but that choice will only become obvious if set grows intern(..) method in addition to add(..). I also wonder how widespread the knowledge of the term "intern" is. I would not be surprised if some non-CS users would be more comfortable with AddAndReturn. > Adding a new method also avoids a whole host of issues with the Set ABC. I am neutral on changing add(..) return value vs. adding a new method. Can you elaborate on the "whole host of issues with the Set ABC". Interestingly, current implementation of add(..) does not match PEP 3119 [1] which calls for a boolean return value. [1] http://www.python.org/dev/peps/pep-3119/#sets ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue7224> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com