Skip to content

Unused type ? #1499

Description

@ar1ja

hello

i run into problems sometimes when i have multiple unused arguments, for example :

    def get_func(
        self,
        clipboard: Any,
        selection_data: Any,
        info: Any,
        data: Any,
    ) -> None:
        """gets clipboard"""
        selection_data.set("BYTES", 8, data)

    def clear_func(self, clipboard: Any, data: Any) -> None:
        """clears clipboard"""

and linters dont like this, so maybe typing could have an Unused type ?

i mean currently ion have a type but i have this :

from typing import Any


class Unused:
    def __init__(self, *args: Any) -> None:
        del args

  def get_func(
        self,
        clipboard: Any,
        selection_data: Any,
        info: Any,
        data: Any,
    ) -> None:
        """gets clipboard"""
        Unused(clipboard, info)
        selection_data.set("BYTES", 8, data)

  def clear_func(self, clipboard: Any, data: Any) -> None:
        """clears clipboard"""
        Unused(clipboard, data)

which works fine, but maybe it should b a type like Unused[int] or Unused[Any] or smt

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic: featureDiscussions about new features for Python's type annotations

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions