Comments (1)
I don't plan to add this sort of signature checking. Receiver functions are intended to get the sender as the first positional argument, and that keeps the API and implementation simple. If you want to reuse an existing function for a receiver without changing its signature, you can write a fairly trivial wrapper for it.
from functools import update_wrapper
def as_receiver(f):
def wrapper(sender, **kwargs):
return f(**kwargs)
return update_wrapper(wrapper, f)
my_receiver = as_receiver(my_func)
my_signal.connect(my_receiver)
from blinker.
Related Issues (20)
- Signal connected to unittest.Mock and MagicMock does not work in Python 3.8 HOT 1
- v1.6.3 hasn't been released on PyPi HOT 1
- Move the version definition to pyproject.toml HOT 2
- Feature Request: Signal which only sends once HOT 1
- SyntaxWarning on python3.12 HOT 2
- the performance of process works not well HOT 1
- Support multiple senders in connect_via HOT 1
- got a problem when use `signal` to create a signal
- DeprecationWarning: invalid escape sequence \* HOT 3
- Dependencies on fresh install cannot be resolved. HOT 1
- Temporarily disable a signal in a block HOT 2
- 1.4: sphinx warnings
- cannot install on centos 7 HOT 1
- Is dispatch_uid required? HOT 1
- Excuse me, why did you remove the send_async method (1.5dev)
- Excuse me, why remove 1.5dev HOT 1
- Use of ParamSpec only works in Python 3.10+ HOT 3
- Version 1.6 maybe include some breaking changes HOT 6
- Release tag is missing for v1.6 HOT 1
- Receiver function without sender argument HOT 1
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 blinker.