3.7 "imports" and "or"

This commit is contained in:
rocky
2020-01-11 07:06:46 -05:00
parent 6cef42f6c7
commit c3d7ba6dad
13 changed files with 52 additions and 12 deletions

View File

@@ -5,12 +5,15 @@
# RUNNABLE!
import os.path as osp
from sys import path
from sys import platform
from os import sep, name
import collections.abc
assert osp.basename("a") == "a"
assert path
assert isinstance(platform, str)
assert sep
assert name
assert collections.abc
import os.path as path
assert path

View File

@@ -8,3 +8,14 @@ def foo(n):
assert foo(95)
assert not foo(94)
assert not foo(96)
# from test_buffer.py
# Bug was handling "or" inside a conditional
def rslice(a, b):
minlen = 0 if a or b else 1
return minlen
assert rslice(False, False) == 1
assert rslice(False, True) == 0
assert rslice(True, False) == 0
assert rslice(True, True) == 0