这是indexloc提供的服务,不要输入任何密码
Skip to content

mypy plugin crashes #232

@eltoder

Description

@eltoder

It looks like mypy plugin does not work with recent mypy versions. Test case

import pydantic_xml as pxml

class Model(pxml.BaseXmlModel):
    elem: int = pxml.element()

produces

$ mypy xml_mypy.py --show-traceback
xml_mypy.py:4: error: INTERNAL ERROR -- Please try using mypy master on GitHub:
https://mypy.readthedocs.io/en/stable/common_issues.html#using-a-development-mypy-build
Please report a bug at https://github.com/python/mypy/issues
version: 1.13.0
Traceback (most recent call last):
  File "mypy/checkexpr.py", line 5848, in accept
  File "mypy/nodes.py", line 1969, in accept
  File "mypy/checkexpr.py", line 480, in visit_call_expr
  File "mypy/checkexpr.py", line 614, in visit_call_expr_inner
  File "mypy/checkexpr.py", line 1471, in check_call_expr_with_callee_type
  File "mypy/checkexpr.py", line 1565, in check_call
  File "mypy/checkexpr.py", line 1811, in check_callable_call
  File "mypy/checkexpr.py", line 1245, in apply_function_plugin
  File "/home/eltoder/dev/scratch/.venv/lib/python3.10/site-packages/pydantic_xml/mypy.py", line 39, in _element_callback
    return super()._pydantic_field_callback(self._pop_first_args(ctx, 4))
AttributeError: 'super' object has no attribute '_pydantic_field_callback'
xml_mypy.py:4: : note: use --pdb to drop into pdb

Mypy version: mypy 1.13.0 (compiled: yes)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingv2Version 2 related

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions