Start working with mypy

This commit is contained in:
Dave Halter
2020-07-25 15:05:42 +02:00
parent 34152d29b2
commit a474895764
5 changed files with 61 additions and 48 deletions

View File

@@ -7,11 +7,7 @@ import shutil
import platform
import logging
import warnings
try:
import cPickle as pickle
except:
import pickle
import pickle
from parso.file_io import FileIO

View File

@@ -149,8 +149,8 @@ class Issue(object):
class Rule(object):
code = None
message = None
code: int
message: str
def __init__(self, normalizer):
self._normalizer = normalizer

View File

@@ -23,7 +23,7 @@ class NodeOrLeaf(object):
The base class for nodes and leaves.
"""
__slots__ = ()
type = None
type: str
'''
The type is a string that typically matches the types of the grammar file.
'''
@@ -257,7 +257,6 @@ class BaseNode(NodeOrLeaf):
A node has children, a type and possibly a parent node.
"""
__slots__ = ('children', 'parent')
type = None
def __init__(self, children):
self.children = children