Comments (3)
Hi @jenda1, thank you for creating this issue.
The problem here is that the decorated generator becomes a Stream
subclass, in order to provide support for pipe-lining (|
), slicing ([]
) and concatenation (+
). That means testit
is not a method and this is why you have to pass the t
instance explicitly in your workaround.
Instead, you could consider this alternative:
@operator
async def stream_from_test_instance(test):
yield test.n
class test:
n = 123
def testit(self):
return stream_from_test_instance(self)
Or, since streams are reusable:
class test:
def __init__(self, n):
self.n = n
self.stream = stream_from_test_instance(self)
def testit(self):
return self.stream
The error message you got isn't really explaining what's happening though. Let's try to detect self
or cls
arguments and raise an exception with a proper explanation.
Hope that helps, thanks again.
from aiostream.
from aiostream.
Let's try to detect self or cls arguments and raise an exception with a proper explanation.
Done ! (see PR #24)
from aiostream.
Related Issues (20)
- Pipeable Operator Gives No Explanation of Issue HOT 2
- composition of streams without initial value HOT 9
- Alternative to the pipe syntax
- Coroutine function detection procudes false negatives
- How to dispatch items from a single source to several concurrent streams? HOT 2
- Idea: Broadcasting to multiple consumers simultaneously HOT 5
- RuntimeError: athrow(): asynchronous generator is already running HOT 2
- aiter-like creation operator HOT 3
- Unexpected error when returning from merged stream HOT 6
- Preserve an aiohttp streaming response. HOT 3
- Async class methods in pipeline HOT 7
- Rate limit / throttle operator HOT 19
- Task exception was never retrieved warning HOT 3
- Cancelling pending tasks in same TaskGroup causes RuntimeError HOT 3
- UnboundLocalError when trying to reuse a stream HOT 1
- iterating from a synchronous iterator blocks the event loop HOT 6
- add support python3.10 HOT 1
- Please upload a wheel release to pypi HOT 2
- `stream.list` implementation is x10 slower than using plain Python built-in functionality (list comprehension) HOT 2
- Idea: Timeouts on chunks HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aiostream.