Why aren't signals simply called events?
From what I can tell, in Python and and Django, signals are simply delegated events. Is there anything that functionally differentiates them from the typical notion of events in C#, Java, ActionScript, etc?
Asked by: Daryl892 | Posted: 06-12-2021
Answer 1
Actually, "signals" have been around longer than events have. In the earliest usage, a signal was an asynchronous way for processes to get notified that events had occurred. Since Unix is much older than Django (and since a lot of the Django work came from pydispatcher, where the original stuff was done), the name has stuck.
Events are really signals, you might say!
Answered by: Elise345 | Posted: 07-01-2022Answer 2
Signals typically have an association with an operating system facility and events are typically application-defined. In some technology stacks, the OS-level stuff may be hidden well enough that there isn't a difference in the API, but in others perhaps not.
Answered by: Kristian475 | Posted: 07-01-2022Answer 3
Afaik Qt had the first signal/slot implementation. Qt's docs explain the metaphor: "A signal is emitted when a particular event occurs". The distinction is so subtle that the nomenclature has been blurred.
Answered by: Anna101 | Posted: 07-01-2022Answer 4
You might as well ask "Why aren't events simply called signals?". Differences in terminology happen.
Answered by: Jack260 | Posted: 07-01-2022Similar questions
pygtk - Python GTK+: create custom signals?
Is it possible to create new signals in Python GTK+ ?
I'd like a skeleton code example, please.
python - PyQt4 signals and slots
I am writing my first Python app with PyQt4. I have a MainWindow and a Dialog class, which is a part of MainWindow class:
self.loginDialog = LoginDialog();
I use slots and signals. Here's a connection made in MainWindow:
QtCore.QObject.connect(self.loginDialog, QtCore.SIGNAL("aa(str)"), self.login)
And I try to emit signal inside the Dialog class (I'm sure...
python - Django signals file, cannot import model names
I have such file order:
project/
app/
models.py
signals.py
I am keeping signals inside signals.py as it should be. and at the top of the signals.py file, I include myapp models as I do queries in these signals with
from myproject.myapp.models import Foo
However it doesnt seem to find it, as I run the server or validate from manage.py, ...
python - How do Django signals work?
How does Django's event routing system work?
python - Proper way to test Django signals
I'm trying to test sent signal and it's providing_args. Signal triggered inside contact_question_create view just after form submission.
My TestCase is something like:
def test_form_should_post_proper_data_via_signal(self):
form_data = {'name': 'Jan Nowak'}
signals.question_posted.send(sender='test', form_data=form_data)
@receiver(signals.question_posted, sen...
python - Django signals as IPC
So I have written a websocket application in Twisted. The application is a basic game between a number of users, but trying to use the web socket for setup and record saving is painful, so I was looking into using Django based rendering for the supplementary information (as in standings, game setup, lobby list, etc) and leave the websockets for the real action. I know I can use some basic IPC functionality to have the Dj...
pyqt - Using Python PyQT4 slots and signals in Monkey Studio
I'm writing my first GUI application using PyQT4 and the Monkey Studio ide.
I've made a dialog (mainwindow.ui) with a button that sends the signal clicked() to the MainWindow's slot slot1()
This is the MainWindow code:
from PyQt4 import uic
(Ui_MainWindow, QMainWindow) = uic.loadUiType('mainwindow.ui')
class MainWindow (QMainWindow):
"""MainWindow inherits QMa...
python - PyQt Signals and slots
I've just started programming in PyQt and I'm following "Rapid GUI programming in Python and Qt" by Mark Summerfield. Before this I did some programming in C++ and Qt and the author of the book which I followed recommended the use of signals and slots, and I too like the use of signals and slots over "on_widgetName_signalName" methods. But I was surprised to see that the author of "Rapid GUI programming in Python and Qt" u...
python - PySide (or PyQt) signals and slots basics
Consider a simple example like this which links two sliders using signals and slots:
from PySide.QtCore import *
from PySide.QtGui import *
import sys
class MyMainWindow(QWidget):
def __init__(self):
QWidget.__init__(self, None)
vbox = QVBoxLayout()
sone = QSlider(Qt.Horizontal)
vbox.addWidget(sone)
stwo = QSlider(Qt.Horizontal)
vbox.addWidget(stwo)
sone.valueChanged.connect(stwo.setValu...
python - Django signals for new entry only
I'm using Django's post_save signal to send emails to users whenever a new article is added to the site. However, users still receive new emails whenever I use save() method for already created articles. How is it possible to receive emails only when NEW entry was added?
Thanks in advance
pygtk - Python GTK+: create custom signals?
Is it possible to create new signals in Python GTK+ ?
I'd like a skeleton code example, please.
python - PyQt4 signals and slots
I am writing my first Python app with PyQt4. I have a MainWindow and a Dialog class, which is a part of MainWindow class:
self.loginDialog = LoginDialog();
I use slots and signals. Here's a connection made in MainWindow:
QtCore.QObject.connect(self.loginDialog, QtCore.SIGNAL("aa(str)"), self.login)
And I try to emit signal inside the Dialog class (I'm sure...
python - Django signals file, cannot import model names
I have such file order:
project/
app/
models.py
signals.py
I am keeping signals inside signals.py as it should be. and at the top of the signals.py file, I include myapp models as I do queries in these signals with
from myproject.myapp.models import Foo
However it doesnt seem to find it, as I run the server or validate from manage.py, ...
python - How do Django signals work?
How does Django's event routing system work?
python - Proper way to test Django signals
I'm trying to test sent signal and it's providing_args. Signal triggered inside contact_question_create view just after form submission.
My TestCase is something like:
def test_form_should_post_proper_data_via_signal(self):
form_data = {'name': 'Jan Nowak'}
signals.question_posted.send(sender='test', form_data=form_data)
@receiver(signals.question_posted, sen...
python - Django signals as IPC
So I have written a websocket application in Twisted. The application is a basic game between a number of users, but trying to use the web socket for setup and record saving is painful, so I was looking into using Django based rendering for the supplementary information (as in standings, game setup, lobby list, etc) and leave the websockets for the real action. I know I can use some basic IPC functionality to have the Dj...
pyqt - Using Python PyQT4 slots and signals in Monkey Studio
I'm writing my first GUI application using PyQT4 and the Monkey Studio ide.
I've made a dialog (mainwindow.ui) with a button that sends the signal clicked() to the MainWindow's slot slot1()
This is the MainWindow code:
from PyQt4 import uic
(Ui_MainWindow, QMainWindow) = uic.loadUiType('mainwindow.ui')
class MainWindow (QMainWindow):
"""MainWindow inherits QMa...
python - PyQt Signals and slots
I've just started programming in PyQt and I'm following "Rapid GUI programming in Python and Qt" by Mark Summerfield. Before this I did some programming in C++ and Qt and the author of the book which I followed recommended the use of signals and slots, and I too like the use of signals and slots over "on_widgetName_signalName" methods. But I was surprised to see that the author of "Rapid GUI programming in Python and Qt" u...
Python Signals between threads
I created a UDP socket server
self.UDPServer = SocketServer.UDPServer( ( UDP_IP, UDP_PORT ), UDPServerHandler )
self.server_thread = threading.Thread( target = self.UDPServer.serve_forever )
self.server_thread.setDaemon( True )
self.server_thread.start()
And this is my UDP handler
class UDPServerHandler( SocketServer.BaseRequestHandler ):
def handle( se...
python - PySide (or PyQt) signals and slots basics
Consider a simple example like this which links two sliders using signals and slots:
from PySide.QtCore import *
from PySide.QtGui import *
import sys
class MyMainWindow(QWidget):
def __init__(self):
QWidget.__init__(self, None)
vbox = QVBoxLayout()
sone = QSlider(Qt.Horizontal)
vbox.addWidget(sone)
stwo = QSlider(Qt.Horizontal)
vbox.addWidget(stwo)
sone.valueChanged.connect(stwo.setValu...
Still can't find your answer? Check out these communities...
PySlackers | Full Stack Python | NHS Python | Pythonist Cafe | Hacker Earth | Discord Python