tributary icon indicating copy to clipboard operation
tributary copied to clipboard

`inspect.getargspec` should be replaced `inspect.getfullargspec`

Open belonesox opened this issue 10 months ago • 0 comments

Describe the bug inspect.getargspec is deprecated since python 3.0 and removed from python 3.11 It should be replaced inspect.getfullargspec

To Reproduce Open and run examples/lazy_examples.ipynb

got AttributeError: module 'inspect' has no attribute 'getargspec' on second cell

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
[/home/effalg/bonus/articles-explained/random/sympy/stats/lazy_examples.ipynb](https://vscode-remote+xn-002d-002d80agpkhkor6f-002exn-002d-002d80apqgfe-002exn-002d-002dp1ai.vscode-resource.vscode-cdn.net/home/effalg/bonus/articles-explained/random/sympy/stats/lazy_examples.ipynb) Cell 3 line 1
----> [1](vscode-notebook-cell://xn--80agpkhkor6f.xn--80apqgfe.xn--p1ai/home/effalg/bonus/articles-explained/random/sympy/stats/lazy_examples.ipynb#W2sdnNjb2RlLXJlbW90ZQ%3D%3D?line=0) a = tl.Node(value=5)
      [2](vscode-notebook-cell://xn--80agpkhkor6f.xn--80apqgfe.xn--p1ai/home/effalg/bonus/articles-explained/random/sympy/stats/lazy_examples.ipynb#W2sdnNjb2RlLXJlbW90ZQ%3D%3D?line=1) b = a + 2
      [3](vscode-notebook-cell://xn--80agpkhkor6f.xn--80apqgfe.xn--p1ai/home/effalg/bonus/articles-explained/random/sympy/stats/lazy_examples.ipynb#W2sdnNjb2RlLXJlbW90ZQ%3D%3D?line=2) c = b % 4

File [~/bonus/articles-explained/.venv/lib/python3.12/site-packages/tributary/lazy/node.py:150](https://vscode-remote+xn-002d-002d80agpkhkor6f-002exn-002d-002d80apqgfe-002exn-002d-002dp1ai.vscode-resource.vscode-cdn.net/home/effalg/bonus/articles-explained/random/sympy/stats/~/bonus/articles-explained/.venv/lib/python3.12/site-packages/tributary/lazy/node.py:150), in Node.__init__(self, value, name, dynamic, use_dual, args, kwargs, graphvizshape)
    147     self._dynamic = True
    149 # callable and args
--> 150 self._callable_is_method = _ismethod(self._value)
    152 # self reference for method calls
    153 self._self_reference = self

File [~/bonus/articles-explained/.venv/lib/python3.12/site-packages/tributary/utils.py:67](https://vscode-remote+xn-002d-002d80agpkhkor6f-002exn-002d-002d80apqgfe-002exn-002d-002dp1ai.vscode-resource.vscode-cdn.net/home/effalg/bonus/articles-explained/random/sympy/stats/~/bonus/articles-explained/.venv/lib/python3.12/site-packages/tributary/utils.py:67), in _ismethod(callable)
     62 def _ismethod(callable):
     63     try:
     64         return callable and (
     65             inspect.ismethod(callable)
     66             or (
---> 67                 inspect.getargspec(callable).args
     68                 and inspect.getargspec(callable).args[0] == "self"
     69             )
     70         )
     71     except TypeError:
     72         return False

AttributeError: module 'inspect' has no attribute 'getargspec'

Expected behavior Should work without errors

Python 3.12.5
tributary             0.2.1

belonesox avatar Dec 17 '24 11:12 belonesox