We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Describe the bug
Partial implements both or and ror the same way:
class Partial(tp.Generic[T]): def __init__(self, f): self.f = f def __or__(self, stage) -> T: return self.f(stage) def __ror__(self, stage) -> T: return self.f(stage) def __call__(self, stage) -> T: return self.f(stage)
Both cannot be correct at the same time; ror is correct and or ought to be removed.
Minimal code to reproduce Small snippet that contains a minimal amount of code.
import pypeln async def inc(x): return x+1 assert list(range(1,11)) == await (range(10) | pypeln.task.map(inc)) assert list(range(1,11)) == await (pypeln.task.map(inc) | range(10))
The first pipe range(10) | pypeln.task.map(inc) is correct according to the API.
range(10) | pypeln.task.map(inc)
The second pipe pypeln.task.map(inc) | range(10) is definitely not valid (and should not be).
pypeln.task.map(inc) | range(10)
Expected behavior
pypeln.task.map(inc) | range(10) should lead to an error.
Deleting or indeed fixes it.
del pypeln.utils.Partial.__or__ await (pypeln.task.map(inc) | range(10))
leads to
TypeError: unsupported operand type(s) for |: 'Partial' and 'range'
Library Info Please provide os info and elegy version.
import pypeln print(pypeln.__version__)
returns 0.4.9
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Describe the bug
Partial implements both or and ror the same way:
Both cannot be correct at the same time; ror is correct and or ought to be removed.
Minimal code to reproduce
Small snippet that contains a minimal amount of code.
The first pipe
range(10) | pypeln.task.map(inc)
is correct according to the API.The second pipe
pypeln.task.map(inc) | range(10)
is definitely not valid (and should not be).Expected behavior
pypeln.task.map(inc) | range(10)
should lead to an error.Deleting or indeed fixes it.
leads to
Library Info
Please provide os info and elegy version.
returns 0.4.9
The text was updated successfully, but these errors were encountered: