binutils-gdb/gdb/python
Lancelot SIX f9e59d060f Use is/is not to check for None in python code.
While reviewing a patch sent to the mailing list, I noticed there are few
places where python code checks if a variable is 'None' or not by using the
comparison operators '==' and '!='.  PEP8[1], which is used as coding standard
in GDB coding standards, recommends using 'is' / 'is not' when comparing to a
singleton such as 'None'.

This patch proposes to change the instances of '== None' by 'is None' and
'!= None' by 'is not None'.

[1] https://www.python.org/dev/peps/pep-0008/

gdb/doc/ChangeLog:

	* python.texi (Writing a Pretty-Printer): Use 'is None' instead of
	'== None'.

gdb/ChangeLog:

	* python/lib/gdb/FrameDecorator.py (FrameDecorator): Use 'is None' instead of
	'== None'.
	(FrameVars): Use 'is not None' instead of '!= None'.
	* python/lib/gdb/command/frame_filters.py (SetFrameFilterPriority): Use 'is None'
	instead of '== None' and 'is not None' instead of '!= None'.

gdb/testsuite/ChangeLog:

	* gdb.base/premature-dummy-frame-removal.py (TestUnwinder): Use
	'is None' instead of '== None' and 'is not None' instead of
	'!= None'.
	* gdb.python/py-frame-args.py (lookup_function): Same.
	* gdb.python/py-framefilter-invalidarg.py (Reverse_Function): Same.
	* gdb.python/py-framefilter.py (Reverse_Function): Same.
	* gdb.python/py-nested-maps.py (lookup_function): Same.
	* gdb.python/py-objfile-script-gdb.py (lookup_function): Same.
	* gdb.python/py-prettyprint.py (lookup_function): Same.
	* gdb.python/py-section-script.py (lookup_function): Same.
	* gdb.python/py-unwind-inline.py (dummy_unwinder): Same.
	* gdb.python/python.exp: Same.
	* gdb.rust/pp.py (lookup_function): Same.
2021-06-08 23:49:05 +01:00
..
lib/gdb Use is/is not to check for None in python code. 2021-06-08 23:49:05 +01:00
py-all-events.def
py-arch.c
py-auto-load.c
py-block.c
py-bpevent.c
py-breakpoint.c
py-cmd.c
py-continueevent.c
py-event-types.def
py-event.c
py-event.h
py-events.h
py-evtregistry.c
py-evts.c
py-exitedevent.c
py-finishbreakpoint.c
py-frame.c
py-framefilter.c gdb: fix some indentation issues 2021-05-27 15:01:28 -04:00
py-function.c
py-gdb-readline.c
py-inferior.c
py-infevents.c
py-infthread.c
py-instruction.c
py-instruction.h
py-lazy-string.c
py-linetable.c
py-newobjfileevent.c
py-objfile.c
py-param.c
py-prettyprint.c gdb: fix some indentation issues 2021-05-27 15:01:28 -04:00
py-progspace.c
py-record-btrace.c
py-record-btrace.h
py-record-full.c
py-record-full.h
py-record.c
py-record.h
py-ref.h
py-registers.c
py-signalevent.c
py-stopevent.c
py-stopevent.h
py-symbol.c Restore gdb.SYMBOL_LABEL_DOMAIN constant 2021-06-03 14:56:55 +02:00
py-symtab.c
py-threadevent.c
py-tui.c Forward mouse click to python TUI window 2021-06-04 16:18:10 +02:00
py-type.c
py-unwind.c
py-utils.c
py-value.c
py-varobj.c
py-xmethods.c
python-config.py
python-internal.h
python.c
python.h