1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-13 13:18:06 +03:00
samba-mirror/python
Douglas Bagnall b37f8f88ea python: do not use "is" for string equality
This is not always going to work, and is not guaranteed to be
consistent even between minor versions.

Here is a simple counterexample:

>>> a = 'hello'
>>> a is 'hello'
True
>>> a is 'hello'.lower()
False
>>> a == a.lower()
True

Possibly it always works for the empty string, but we cannot rely
on that.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Mon Oct 29 23:13:36 CET 2018 on sn-devel-144
2018-10-29 23:13:36 +01:00
..
examples PEP8: fix W291: trailing whitespace 2018-08-24 07:49:31 +02:00
samba python: do not use "is" for string equality 2018-10-29 23:13:36 +01:00
samba_external Move python modules from source4/scripting/python/ to python/. 2013-03-02 03:57:34 +01:00
modules.c python: Port simple libpython module to Python 3 compatible form 2017-06-13 22:46:14 +02:00
modules.h Move python modules from source4/scripting/python/ to python/. 2013-03-02 03:57:34 +01:00
py3compat.h python: Add compatability helpers to determine if type is really bytes 2018-03-23 07:28:25 +01:00
pyglue.c python: py_strcasecmp_m & py_strstr_m don't handle unicode properly 2018-10-23 05:50:26 +02:00
wscript python/wscript: update to handle waf 2.0.4 2018-09-05 06:37:23 +02:00