Skip to content

Added pyphen#15645

Merged
JelleZijlstra merged 5 commits intopython:mainfrom
Tesla2000:pyphen
May 10, 2026
Merged

Added pyphen#15645
JelleZijlstra merged 5 commits intopython:mainfrom
Tesla2000:pyphen

Conversation

@Tesla2000
Copy link
Copy Markdown
Contributor

The authors are oposed Kozea/Pyphen#81 (comment) to adding type hints directly

@Tesla2000 Tesla2000 marked this pull request as ready for review April 14, 2026 15:03
@github-actions

This comment has been minimized.

Comment thread stubs/pyphen/pyphen/__init__.pyi Outdated
cut: int

def __init__(self, pattern: str, alternative: str) -> None: ...
def __call__(self, value: str) -> int: ...
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
def __call__(self, value: str) -> int: ...
def __call__(self, value: str | int) -> int: ...

Or even SupportsInt.

Comment thread stubs/pyphen/pyphen/__init__.pyi Outdated
def __call__(self, value: str) -> int: ...

class DataInt(int):
def __new__(cls, value: int, data: Any = ..., reference: DataInt | None = ...) -> Self: ...
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Missing the data attribute (which can be at least DataInt or None, possibly more types).

@github-actions

This comment has been minimized.

@github-actions
Copy link
Copy Markdown
Contributor

Diff from mypy_primer, showing the effect of this PR on open source code:

pandas (https://github.com/pandas-dev/pandas)
- pandas/core/computation/ops.py:328: error: Need type annotation for "_binary_ops_dict" (hint: "_binary_ops_dict: dict[<type>, <type>] = ...")  [var-annotated]

@Tesla2000
Copy link
Copy Markdown
Contributor Author

@JelleZijlstra thanks for the change I was going to address that but couldn't find time

@JelleZijlstra JelleZijlstra merged commit 669d5cb into python:main May 10, 2026
42 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants