Issue32828
This issue tracker has been migrated to GitHub,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2018-02-12 11:54 by dilyan.palauzov, last changed 2022-04-11 14:58 by admin. This issue is now closed.
Messages (3) | |||
---|---|---|---|
msg312039 - (view) | Author: Дилян Палаузов (dilyan.palauzov) | Date: 2018-02-12 11:54 | |
diff --git a/Lib/_strptime.py b/Lib/_strptime.py --- a/Lib/_strptime.py +++ b/Lib/_strptime.py @@ -525,7 +525,7 @@ def _strptime(data_string, format="%a %b %d %H:%M:%S %Y"): # out the Julian day of the year. if julian is None and weekday is not None: if week_of_year is not None: - week_starts_Mon = True if week_of_year_start == 0 else False + week_starts_Mon = week_of_year_start == 0 julian = _calc_julian_from_U_or_W(year, week_of_year, weekday, week_starts_Mon) elif iso_year is not None and iso_week is not None: diff --git a/Lib/email/generator.py b/Lib/email/generator.py --- a/Lib/email/generator.py +++ b/Lib/email/generator.py @@ -59,7 +59,7 @@ class Generator: """ if mangle_from_ is None: - mangle_from_ = True if policy is None else policy.mangle_from_ + mangle_from_ = policy is None or policy.mangle_from_ self._fp = outfp self._mangle_from_ = mangle_from_ self.maxheaderlen = maxheaderlen diff --git a/Lib/test/test_buffer.py b/Lib/test/test_buffer.py --- a/Lib/test/test_buffer.py +++ b/Lib/test/test_buffer.py @@ -576,7 +576,7 @@ def rand_aligned_slices(maxdim=5, maxshape=16): minshape = 0 elif n >= 90: minshape = 1 - all_random = True if randrange(100) >= 80 else False + all_random = randrange(100) >= 80 lshape = [0]*ndim; rshape = [0]*ndim lslices = [0]*ndim; rslices = [0]*ndim diff --git a/Lib/test/test_decimal.py b/Lib/test/test_decimal.py --- a/Lib/test/test_decimal.py +++ b/Lib/test/test_decimal.py @@ -117,7 +117,7 @@ skip_expected = not os.path.isdir(directory) EXTENDEDERRORTEST = False # Test extra functionality in the C version (-DEXTRA_FUNCTIONALITY). -EXTRA_FUNCTIONALITY = True if hasattr(C, 'DecClamped') else False +EXTRA_FUNCTIONALITY = hasattr(C, 'DecClamped') requires_extra_functionality = unittest.skipUnless( EXTRA_FUNCTIONALITY, "test requires build with -DEXTRA_FUNCTIONALITY") skip_if_extra_functionality = unittest.skipIf( @@ -1455,7 +1455,7 @@ class ArithmeticOperatorsTest(unittest.TestCase): for x, y in qnan_pairs + snan_pairs: for op in order_ops + equality_ops: got = op(x, y) - expected = True if op is operator.ne else False + expected = op is operator.ne self.assertIs(expected, got, "expected {0!r} for operator.{1}({2!r}, {3!r}); " "got {4!r}".format( @@ -1468,7 +1468,7 @@ class ArithmeticOperatorsTest(unittest.TestCase): for x, y in qnan_pairs: for op in equality_ops: got = op(x, y) - expected = True if op is operator.ne else False + expected = op is operator.ne self.assertIs(expected, got, "expected {0!r} for " "operator.{1}({2!r}, {3!r}); " diff --git a/Lib/test/test_winreg.py b/Lib/test/test_winreg.py --- a/Lib/test/test_winreg.py +++ b/Lib/test/test_winreg.py @@ -20,13 +20,13 @@ except (IndexError, ValueError): # tuple of (major, minor) WIN_VER = sys.getwindowsversion()[:2] # Some tests should only run on 64-bit architectures where WOW64 will be. -WIN64_MACHINE = True if machine() == "AMD64" else False +WIN64_MACHINE = machine() == "AMD64" # Starting with Windows 7 and Windows Server 2008 R2, WOW64 no longer uses # registry reflection and formerly reflected keys are shared instead. # Windows 7 and Windows Server 2008 R2 are version 6.1. Due to this, some # tests are only valid up until 6.1 -HAS_REFLECTION = True if WIN_VER < (6, 1) else False +HAS_REFLECTION = WIN_VER < (6, 1) # Use a per-process key to prevent concurrent test runs (buildbot!) from # stomping on each other. |
|||
msg312057 - (view) | Author: R. David Murray (r.david.murray) * | Date: 2018-02-12 15:06 | |
The one in generator.py should not be changed, it is clearer as written. I don't have a strong opinion on the others. |
|||
msg312061 - (view) | Author: R. David Murray (r.david.murray) * | Date: 2018-02-12 15:56 | |
Oops. I actually didn't intend to close this, but thinking about it I'm going to leave it closed. We generally don't do this kind of "tidy work" unless we are touching the code for other reasons. |
History | |||
---|---|---|---|
Date | User | Action | Args |
2022-04-11 14:58:57 | admin | set | github: 77009 |
2018-02-12 15:56:00 | r.david.murray | set | messages: + msg312061 |
2018-02-12 15:06:48 | r.david.murray | set | status: open -> closed nosy: + r.david.murray messages: + msg312057 resolution: rejected stage: resolved |
2018-02-12 11:54:27 | dilyan.palauzov | create |