Skip to content

Commit cdbc2d5

Browse files
committed
feat: Add decorator functools.lru_cache to method tkinter.Misc.winfo_rgb
1 parent aef52ca commit cdbc2d5

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Lib/tkinter/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
import enum
3535
import sys
3636
import types
37+
import functools
3738

3839
import _tkinter # If this fails your Python may not be configured for Tk
3940
TclError = _tkinter.TclError
@@ -1314,6 +1315,7 @@ def winfo_reqwidth(self):
13141315
return self.tk.getint(
13151316
self.tk.call('winfo', 'reqwidth', self._w))
13161317

1318+
@functools.lru_cache
13171319
def winfo_rgb(self, color):
13181320
"""Return a tuple of integer RGB values in range(65536) for color in this widget."""
13191321
return self._getints(

0 commit comments

Comments
 (0)