Skip to content

Adding Typehinting or Stubfiles to mpyc #105

Closed

Description

@Vizonex

I was thinking about contributing to this library by adding some typehints since in python 3.10, you can use annotations so that tools like pyright or mypy can aid a developer in fixing and changing code in the longrun. I have a stubfile I wrote for the mpctools module as an example.

from typing import Callable, Sequence, Any
import operator
# unsure what runtime is but I'll figure it out...
runtime:  Any | None = None

class NoValueType(object):
    __doc__:str | None
    def __repr__(self) -> str: ...

_no_value: NoValueType

def reduce(f:Callable[[int, int], int], x:Sequence[int], initial=_no_value) -> int: ...
def accumulate(x:Sequence[int], f:Callable[[int, int], int] = operator.add, initial=_no_value) -> Iterator[int]: ...

Activity

  1. Repository owner locked and limited conversation to collaborators on Jan 31, 2026
  2. converted this issue into a discussion #114 on Jan 31, 2026
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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions