Skip to content

Too many arguments for type[tuple[Any, ...]] #1649

@metaist

Description

@metaist

Summary

https://play.ty.dev/76cd71f0-4755-4309-8277-2ee2740494d6

tuple[Any, ...] works fine, but when it's type[tuple[Any, ...]] the variadic tuple signature is rejected.

from typing import Any
ok: tuple[Any, ...]
fails: type[tuple[Any, ...]] # too-many-positional-arguments
error[too-many-positional-arguments]: Too many positional arguments to class `tuple`: expected 1, got 2
 --> test_variadic_tuple_type.py:4:13
  |
3 | ok: tuple[Any, ...]
4 | fails: type[tuple[str, ...]]
  |             ^^^^^^^^^^^^^^^
  |
info: rule `too-many-positional-arguments` is enabled by default

Version

ty 0.0.1-alpha.28

Metadata

Metadata

Assignees

No one assigned

    Labels

    typing semanticstyping-module features, spec compliance, etc

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions