Skip to content

Commit 8b15dff

Browse files
vaibhavhrtjreback
authored andcommitted
Fix type annotation in pandas. version (#25949)
1 parent 435e2b5 commit 8b15dff

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

mypy.ini

-3
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ follow_imports=silent
55
[mypy-pandas.conftest,pandas.tests.*]
66
ignore_errors=True
77

8-
[mypy-pandas._version]
9-
ignore_errors=True
10-
118
[mypy-pandas.compat]
129
ignore_errors=True
1310

pandas/_version.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import re
1313
import subprocess
1414
import sys
15+
from typing import Callable, Dict
1516

1617
from pandas.compat import PY3
1718

@@ -48,12 +49,11 @@ class NotThisMethod(Exception):
4849
pass
4950

5051

51-
LONG_VERSION_PY = {}
52-
HANDLERS = {}
52+
HANDLERS = {} # type: Dict[str, Dict[str, Callable]]
5353

5454

55-
def register_vcs_handler(vcs, method): # decorator
56-
def decorate(f):
55+
def register_vcs_handler(vcs: str, method: str) -> Callable: # decorator
56+
def decorate(f: Callable) -> Callable:
5757
if vcs not in HANDLERS:
5858
HANDLERS[vcs] = {}
5959
HANDLERS[vcs][method] = f

0 commit comments

Comments
 (0)