Repository navigation
SUMM/REF: refactor link argument in family - #3370
Conversation
|
Looks good overall, based on very quick browsing of the changes. |
|
The Tweedie |
|
As possibly the only user of Thanks! |
|
The Tweedie |
|
@lorentzenchr Sorry for the slow reply (I had another unplanned detour in topics this week) |
|
|
||
| def __init__(self, link, variance): | ||
| self.link = link() | ||
| if inspect.isclass(link): |
There was a problem hiding this comment.
I think we can avoid loading the inspect module and check directly
isinstance(link, type)
There was a problem hiding this comment.
It seems that inspect.isclass(object) is implemented as isinstance(object, type), see source. But this might work for python 3 only. According to this stackoverflow answer, the python 2 version needs types.ClassType which was removed in python 3. So I would stick with inspect.isclass.
There was a problem hiding this comment.
I looked at the stackoverflow question, but I think the problem is only with old style classes which we don't use. But I don't have a python 2 open right now to check
|
merged @lorentzenchr Thank you |
REF: refactor link argument in family (cherry picked from commit 706f4b9)
This should solve issue #2913.