File tree Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Original file line number Diff line number Diff line change 12
12
import string
13
13
import sys
14
14
import time
15
- import types
16
15
import unicodedata
17
16
import warnings
18
17
from collections import defaultdict , namedtuple
19
18
from contextlib import contextmanager
20
19
from functools import partial
21
20
from threading import Event , Thread
22
- from types import FunctionType
21
+ from types import FunctionType , GeneratorType
23
22
24
23
import numpy as np
25
24
import param
@@ -507,7 +506,7 @@ def callable_name(callable_obj):
507
506
return callable_obj .__name__
508
507
elif inspect .ismethod (callable_obj ): # instance and class methods
509
508
return callable_obj .__func__ .__qualname__ .replace ('.__call__' , '' )
510
- elif isinstance (callable_obj , types . GeneratorType ):
509
+ elif isinstance (callable_obj , GeneratorType ):
511
510
return callable_obj .__name__
512
511
else :
513
512
return type (callable_obj ).__name__
Original file line number Diff line number Diff line change 1
1
import datetime as dt
2
2
import inspect
3
3
import sys
4
- import types
4
+ from types import GeneratorType
5
5
6
6
7
7
# gen_types is copied from param, can be removed when
@@ -35,7 +35,7 @@ def gen_types(gen_func):
35
35
36
36
37
37
# Types
38
- generator_types = (zip , range , types . GeneratorType )
38
+ generator_types = (zip , range , GeneratorType )
39
39
40
40
41
41
@gen_types
You can’t perform that action at this time.
0 commit comments