File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change 66"""Defines :class:`scopedef_t` class"""
77
88import timeit
9- import collections
9+ try :
10+ from collections .abc import Callable
11+ except ImportError :
12+ from collections import Callable
1013
1114from . import algorithm
1215from . import templates
@@ -312,7 +315,7 @@ def init_optimizer(self):
312315
313316 @staticmethod
314317 def _build_operator_function (name , function ):
315- if isinstance (name , collections . Callable ):
318+ if isinstance (name , Callable ):
316319 return name
317320
318321 return function
@@ -324,7 +327,7 @@ def add_operator(sym):
324327 if 'new' in sym or 'delete' in sym :
325328 return 'operator ' + sym
326329 return 'operator' + sym
327- if isinstance (name , collections . Callable ) and None is function :
330+ if isinstance (name , Callable ) and None is function :
328331 name = None
329332 if name :
330333 if 'operator' not in name :
@@ -347,7 +350,7 @@ def _on_rename(self):
347350 @staticmethod
348351 def __normalize_args (** keywds ):
349352 """implementation details"""
350- if isinstance (keywds ['name' ], collections . Callable ) and \
353+ if isinstance (keywds ['name' ], Callable ) and \
351354 None is keywds ['function' ]:
352355 keywds ['function' ] = keywds ['name' ]
353356 keywds ['name' ] = None
You can’t perform that action at this time.
0 commit comments