﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
37307	Short-circuit evaluation issue	Twain Byrnes		"Hello,

There are several instances of a potentially problematic behavior in the Python code of the form:

{{{#!div style=""font-size: 80%""
Code highlighting:
  {{{#!python
  def fun_name(par=None):
    par = par or default_value
    ...
  }}}
}}}

which may be passed a non-None value of the wrong type, potentially causing errors. I have not found any instances where there it is possible for something to be passed in with the wrong type, but for future-proofing, it may be advisable to change them to the following form:

{{{#!div style=""font-size: 80%""
Code highlighting:
  {{{#!python
  def fun_name(par=None):
     if par is None:
       par = default_value
     ...
  }}}
}}}

I have listed several such instances below:
1. In `django/db/models/fields/__init__.py`, lines 1101 and 1115
2. In `django/db/models/base.py`, lines 705 and 706, lines 853 and 867, lines 962 and 974, lines 1333 and 1339

If there is interest, I can also submit a CodeQL query to uncover the remaining items of this form."	Bug	new	Uncategorized	6.1	Normal			Twain Byrnes	Unreviewed	1	0	0	0	1	0
