Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions stubs/braintree/braintree/search.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from _typeshed import Incomplete
from _typeshed import Incomplete, Unused
from typing import overload

class Search:
class IsNodeBuilder:
Expand Down Expand Up @@ -41,7 +42,12 @@ class Search:
name: Incomplete
whitelist: Incomplete
def __init__(self, name, whitelist=[]) -> None: ...
def in_list(self, *values): ...

@overload
def in_list(self, value: list[str], *values: Unused) -> Search.Node: ...
@overload
def in_list(self, *values: str) -> Search.Node: ...

@donbarbos donbarbos Aug 18, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since a list can be used as such a sequence of values for the first argument, I think it might be worth adding an overload for this case.
(Please, import Unused from _typeshed)

Suggested change
def in_list(self, *values: str) -> Search.Node: ...
@overload
def in_list(self, value: list[str], *values: Unused) -> Search.Node: ...
@overload
def in_list(self, *values: str) -> Search.Node: ...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@donbarbos oops, missed that. Thanks!


def __eq__(self, value): ...

class MultipleValueOrTextNodeBuilder(TextNodeBuilder, MultipleValueNodeBuilder):
Expand Down