FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

bpo-39943: Remove unused arg from find_nfc_index() by petdance · Pull Request #18950 · python/cpython · GitHub

Repository navigation

Prev Previous commit
Next Next commit
bpo-39689: Do not test undefined casts to _Bool (GH-18964)
- When casting to _Bool, arrays should only contain zeros or ones.
  • Loading branch information
Stefan Krah authored and petdance committed Mar 13, 2020
commit 9d781c945da8046d3afcccaa2b30bb5c77c9eed1
4 changes: 4 additions & 0 deletions Lib/test/test_buffer.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -2754,6 +2754,10 @@ def test_memoryview_cast_1D_ND(self):
# be 1D, at least one format must be 'c', 'b' or 'B'.
for _tshape in gencastshapes():
for char in fmtdict['@']:
# Casts to _Bool are undefined if the source contains values
# other than 0 or 1.
if char == "?":
continue
tfmt = ('', '@')[randrange(2)] + char
tsize = struct.calcsize(tfmt)
n = prod(_tshape) * tsize
Expand Down

Back | FazBrowse Home | New Git URL