mirror of https://github.com/cool-RR/PySnooper.git
BaseVariable is an ABC
This commit is contained in:
parent
e3688e4b63
commit
4ebbbf8226
|
@ -1,11 +1,12 @@
|
||||||
import itertools
|
import itertools
|
||||||
|
from abc import ABC, abstractmethod
|
||||||
from collections import Mapping, Sequence
|
from collections import Mapping, Sequence
|
||||||
from copy import deepcopy
|
from copy import deepcopy
|
||||||
|
|
||||||
from . import utils
|
from . import utils
|
||||||
|
|
||||||
|
|
||||||
class BaseVariable(object):
|
class BaseVariable(ABC):
|
||||||
def __init__(self, source, exclude=()):
|
def __init__(self, source, exclude=()):
|
||||||
self.source = source
|
self.source = source
|
||||||
self.exclude = utils.ensure_tuple(exclude)
|
self.exclude = utils.ensure_tuple(exclude)
|
||||||
|
@ -18,6 +19,7 @@ class BaseVariable(object):
|
||||||
return ()
|
return ()
|
||||||
return self._items(main_value)
|
return self._items(main_value)
|
||||||
|
|
||||||
|
@abstractmethod
|
||||||
def _items(self, key):
|
def _items(self, key):
|
||||||
raise NotImplementedError()
|
raise NotImplementedError()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue