Hello,
consider this snippet please
cursor.execute(f"INSERT INTO {table} VALUES (1, '{}');")
SyntaxError: f-string: empty expression not allowed
It is (absolutely) correct to insert empty json into database table field.
Empty expression in f-string should
* (silently) expand as '{}' (opening and closing braces),
* generate a (compile time) warning if requested, e.g. with -W.
Thank you in advance
Hans
_______________________________________________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
https://mail.python.org/archives/list/[email protected]/message/P2JVICNTXT5WEHGVLBGZASKBOC2CNSVF/
Code of Conduct: http://python.org/psf/codeofconduct/