[meld] Minor type hint additions in painful places



commit 6dd36bba7ab96df8db08543b1740d99c5911654b
Author: Kai Willadsen <kai willadsen gmail com>
Date:   Sun Jan 20 06:11:47 2019 +1000

    Minor type hint additions in painful places

 meld/ui/emblemcellrenderer.py | 5 ++++-
 meld/vc/_vc.py                | 5 +++--
 2 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/meld/ui/emblemcellrenderer.py b/meld/ui/emblemcellrenderer.py
index d9f369fb..4cebd040 100644
--- a/meld/ui/emblemcellrenderer.py
+++ b/meld/ui/emblemcellrenderer.py
@@ -14,8 +14,11 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+from typing import Dict, Tuple
+
 import cairo
 from gi.repository import Gdk
+from gi.repository import GdkPixbuf
 from gi.repository import GObject
 from gi.repository import Gtk
 
@@ -24,7 +27,7 @@ class EmblemCellRenderer(Gtk.CellRenderer):
 
     __gtype_name__ = "EmblemCellRenderer"
 
-    icon_cache = {}
+    icon_cache: Dict[Tuple[str, int], GdkPixbuf.Pixbuf] = {}
 
     icon_name = GObject.Property(
         type=str,
diff --git a/meld/vc/_vc.py b/meld/vc/_vc.py
index 11ab5d78..d592e8ea 100644
--- a/meld/vc/_vc.py
+++ b/meld/vc/_vc.py
@@ -29,6 +29,7 @@ import re
 import shutil
 import subprocess
 import tempfile
+from typing import ClassVar
 
 from gi.repository import Gio
 from gi.repository import GLib
@@ -126,12 +127,12 @@ class Entry:
 
 class Vc:
 
-    VC_DIR = None
+    VC_DIR: ClassVar[str]
 
     #: Whether to walk the current location's parents to find a
     #: repository root. Only used in legacy version control systems
     #: (e.g., old SVN, CVS, RCS).
-    VC_ROOT_WALK = True
+    VC_ROOT_WALK: ClassVar[bool] = True
 
     def __init__(self, path):
         # Save the requested comparison location. The location may be a


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]