8000 Make typing functions using protocols more ergonomic · Issue #709 · evhub/coconut · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Make typing functions using protocols more ergonomic #709
Closed
@evhub

Description

@evhub

Should compile

def func[T <: (+) & (*)](x: T, y: T) -> T = x + x * y

to the equivalent of

def func[T <: ProtocolIntersection[SupportsAdd, SupportsMul]](x: T, y: T) -> T = x + x * y

where SupportsAdd is some special Coconut typing.Protocol for supporting __add__ and ProtocolIntersection is from here.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0