Skip to content

Issue with new mypy #1299

Description

@cunla

Hi, when using mypy 1.19.1, getting error with pynamodb plugin.

python/mypy#20746 (comment)

Traceback (most recent call last):
  File "mypy/checkexpr.py", line 6103, in accept
  File "mypy/checkexpr.py", line 6138, in accept_maybe_cache
  File "mypy/nodes.py", line 2289, in accept
  File "mypy/checkexpr.py", line 508, in visit_call_expr
  File "mypy/checkexpr.py", line 645, in visit_call_expr_inner
  File "mypy/checkexpr.py", line 1496, in check_call_expr_with_callee_type
  File "mypy/checkexpr.py", line 1589, in check_call
  File "mypy/checkexpr.py", line 1832, in check_callable_call
  File "mypy/checkexpr.py", line 1270, in apply_function_plugin
  File "/Users/style/cfa/d20-functions/.venv/lib/python3.12/site-packages/pynamodb_mypy/plugin.py", line 150, in _get_function_hook__pynamodb_attribute__init__
    self._inspect_pynamodb_attribute_init(ctx)
  File "/Users/style/cfa/d20-functions/.venv/lib/python3.12/site-packages/pynamodb_mypy/plugin.py", line 207, in _inspect_pynamodb_attribute_init
    attr_type = get_descriptor_access_type(ctx.context, internal_api, attr_instance)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/style/cfa/d20-functions/.venv/lib/python3.12/site-packages/pynamodb_mypy/_private_api.py", line 20, in get_descriptor_access_type
    mypy.checkmember.MemberContext(
TypeError: 'msg' is an invalid keyword argument for __init__()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions