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 serhiy.storchaka
Recipients GNJ, klappnase, serhiy.storchaka, tkinter
Date 2016-10-24.11:22:36
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1477308158.55.0.397752889679.issue28498@psf.upfronthosting.co.za>
In-reply-to
Content
First, thank you Miguel and klappnase for your patches. But they should be provided in different way, as described in Python Developer’s Guide [1].

> I totally disagree of this change on your patch:

This is not my patch. This is regenerated klappnase's. I expected this will allow to use the Rietveld Code Review Tool for reviewing, but unfortunately Rietveld don't accept these patches [2]. Below I added comments to the patch.

I agree, that all these complications are not needed. Just use getboolean(). It always returns bool in recent Python.

And don't bother about _configure(). Just duplicate the code. It can be refactored later, in separate issue.

Since this is a new feature, it can added only in developing version (future 3.7). Forgot about 2.7 and 3.5. If make the patch fast, there is a chance to get it in 3.6 (if release manager accept this). But tests are needed.

> At least with python 3.4 here wantobjects still is valid, and personally I really hope that it remains this way, because I use to set wantobjects=False in my own code to avoid having to deal with errors because of some method or other unexpectedly returning TclObjects instead of Python objects (which has been happening here occasionally ever since they were invented).

There was an attempt to deprecate wantobjects=False (issue3015), but it is useful for testing and I think third-party program still can use it. If you encounter an error because some standard method return Tcl_Object, please file a bug. This is considered as a bug, and several similar bugs was fixed in last years.

Here are comments to the last klappnase's patch. Please add a serial number to your next patch for easier referring patches.

+    def tk_busy(self, **kw):

Shouldn't it be just an alias to tk_busy_hold?

+        '''Queries the busy command configuration options for
+        this window.

PEP 257: "Multi-line docstrings consist of a summary line just like a one-line docstring, followed by a blank line, followed by a more elaborate description."

+        any of the values accepted by busy_hold().'''

PEP 257: "Unless the entire docstring fits on a line, place the closing quotes on a line by themselves."

+        return(self.tk.call('tk', 'busy', 'cget', self._w, '-'+option))

Don't use parentheses around the return value.

+        the busy cursor can be specified for it by :

Remove a space before colon, add an empty line after it.

+    def tk_busy_hold(self, **kw):

Since the only supported option is cursor, just declare it.

    def tk_busy_hold(self, cursor=None):

+            -cursor cursorName

"-cursor cursorName" is not Python syntax for passing arguments.

+        return((self.tk.getboolean(self.tk.call(
+                'tk', 'busy', 'status', self._w)) and True) or False)

Just return the result of self.tk.getboolean().

[1] https://docs.python.org/devguide/
[2] http://bugs.python.org/review/28498/
History
Date User Action Args
2016-10-24 11:22:38serhiy.storchakasetrecipients: + serhiy.storchaka, klappnase, tkinter, GNJ
2016-10-24 11:22:38serhiy.storchakasetmessageid: <1477308158.55.0.397752889679.issue28498@psf.upfronthosting.co.za>
2016-10-24 11:22:38serhiy.storchakalinkissue28498 messages
2016-10-24 11:22:37serhiy.storchakacreate