[Development] A modest proposal: disable lower-case keywords (emit, foreach, forever, signals, slots) by default

Cristián Maureira-Fredes Cristian.Maureira-Fredes at qt.io
Wed Feb 26 16:48:19 CET 2020



On 2/15/20 3:23 PM, Marc Mutz via Development wrote:
> Hi,
> 
> C++20 will contain new classes with emit() member functions 
> (wg21.link/P0053). 
> <snip>

Hello,

I know this discussion is about C++,
but I just wanted to mention that Signals
in Python are objects, and we rely on the emit method
to emit signals (duh!).


As a C++ programmer,
renaming the emit macro for something else doesn't affect
me, even if we decide to remove it, because I think we can
do fine, so I have no strong feelings.

As a Python programmer,
removing the macro will cause headaches when trying to figure
out how to make Signals work, since looking at some random
Qt/C++ code I will not know what's the proper way of emitting one.
(In case I'm not aware of these conventions)

As a PySide developer,
if we agree to change the name, we can just rename the function
we expose, to qEmit or whatever, but in case the macro gets
removed, we will need to keep the emit() method,
and explain to users that in C++ land this doesn't exists,
which will maybe cause some headaches.

My 3 cents,

Cheers

PS:
More info about signals and slots in PySide:
https://wiki.qt.io/Qt_for_Python_Signals_and_Slots


-- 
Dr. Cristian Maureira-Fredes
R&D Manager

The Qt Company GmbH
Erich-Thilo-Str. 10
D-12489 Berlin

Geschäftsführer: Mika Pälsi,
Juha Varelius, Mika Harjuaho
Sitz der Gesellschaft: Berlin,
Registergericht: Amtsgericht
Charlottenburg, HRB 144331 B


More information about the Development mailing list