Gregor Lingl <[EMAIL PROTECTED]> added the comment: I agree to Martin's patch for 2.6, because it seems to provide a more clean solution. And, as he states, there will be time and opportunity to discuss it more thoroughly later to possibly find another approach. As I remarked before I know that singleton+inheritance is a controversial subject. However the gang of four state in their book that one should use the singleton design pattern if one needs exactly one instance af a class and this should be extensible by subclassing ... (And there are reasons why I'd like to have Screen() subclassable.)
Anyway, I think there are two more things to do: 1) Add a docstring to the Screen() function 2) Insert (at least) one sentence in the docs, 9.th paragraph of the Introduction. Something like: ... so there can exist only one instance of Screen at a time. *Notice that consequently Screen cannot be sublassed.* It should be used when turtle is used as a standalone tool for doing graphics. ... Perhaps one should also note, that the singleton object is returned by a function. I've applied the proposed patch (file11645) to a working copy and I've tested it in interactive mode as well as with turtleDemo and all the supplied demoscripts and found it to work well. Last, but not least: thanks Martin for your contribution. Regards, Gregor _______________________________________ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue3956> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com