tests/cpydiff/: Improve wording, add more workarounds.
This commit is contained in:
parent
ad5e7a0e6f
commit
0c5369a1f0
@ -1,7 +1,7 @@
|
|||||||
"""
|
"""
|
||||||
categories: Modules,sys
|
categories: Modules,sys
|
||||||
description: Override sys.stdin, sys.stdout and sys.stderr. Impossible as they are stored in read-only memory.
|
description: Overriding sys.stdin, sys.stdout and sys.stderr not possible
|
||||||
cause: Unknown
|
cause: They are stored in read-only memory.
|
||||||
workaround: Unknown
|
workaround: Unknown
|
||||||
"""
|
"""
|
||||||
import sys
|
import sys
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
"""
|
"""
|
||||||
categories: Types,bytes
|
categories: Types,bytes
|
||||||
description: bytes(...) with keywords not implemented
|
description: bytes() with keywords not implemented
|
||||||
cause: Unknown
|
cause: Unknown
|
||||||
workaround: Input the encoding format directly. eg. ``print(bytes('abc', 'utf-8'))``
|
workaround: Pass the encoding as a positional paramter, e.g. ``print(bytes('abc', 'utf-8'))``
|
||||||
"""
|
"""
|
||||||
print(bytes('abc', encoding='utf8'))
|
print(bytes('abc', encoding='utf8'))
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
"""
|
"""
|
||||||
categories: Types,bytes
|
categories: Types,bytes
|
||||||
description: Bytes subscr with step != 1 not implemented
|
description: Bytes subscription with step != 1 not implemented
|
||||||
cause: Unknown
|
cause: MicroPython is highly optimized for memory usage.
|
||||||
workaround: Unknown
|
workaround: Use explicit loop for this very rare operation.
|
||||||
"""
|
"""
|
||||||
print(b'123'[0:3:2])
|
print(b'123'[0:3:2])
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
"""
|
"""
|
||||||
categories: Types,Exception
|
categories: Types,Exception
|
||||||
description: Assign instance variable to exception
|
description: User-defined attributes for builtin exceptions are not supported
|
||||||
cause: Unknown
|
cause: MicroPython is highly optimized for memory usage.
|
||||||
workaround: Unknown
|
workaround: Use user-defined exception subclasses.
|
||||||
"""
|
"""
|
||||||
e = Exception()
|
e = Exception()
|
||||||
e.x = 0
|
e.x = 0
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
"""
|
"""
|
||||||
categories: Types,Exception
|
categories: Types,Exception
|
||||||
description: While loop guards will obscure exception line number reporting due to being optimised onto the end of the code block
|
description: Exception in while loop condition may have unexpected line number
|
||||||
cause: Unknown
|
cause: Condition checks are optimized to happen at the end of loop body, and that line number is reported.
|
||||||
workaround: Unknown
|
workaround: Unknown
|
||||||
"""
|
"""
|
||||||
l = ["-foo", "-bar"]
|
l = ["-foo", "-bar"]
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
"""
|
"""
|
||||||
categories: Types,float
|
categories: Types,float
|
||||||
description: uPy and CPython outputs formats differ
|
description: uPy and CPython outputs formats may differ
|
||||||
cause: Unknown
|
cause: Unknown
|
||||||
workaround: Unknown
|
workaround: Unknown
|
||||||
"""
|
"""
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
categories: Types,int
|
categories: Types,int
|
||||||
description: No int conversion for int-derived types available
|
description: No int conversion for int-derived types available
|
||||||
cause: Unknown
|
cause: Unknown
|
||||||
workaround: Unknown
|
workaround: Avoid subclassing builtin types unless really needed. Prefer https://en.wikipedia.org/wiki/Composition_over_inheritance .
|
||||||
"""
|
"""
|
||||||
class A(int):
|
class A(int):
|
||||||
__add__ = lambda self, other: A(int(self) + other)
|
__add__ = lambda self, other: A(int(self) + other)
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
categories: Types,list
|
categories: Types,list
|
||||||
description: List delete with step != 1 not implemented
|
description: List delete with step != 1 not implemented
|
||||||
cause: Unknown
|
cause: Unknown
|
||||||
workaround: Unknown
|
workaround: Use explicit loop for this rare operation.
|
||||||
"""
|
"""
|
||||||
l = [1, 2, 3, 4]
|
l = [1, 2, 3, 4]
|
||||||
del l[0:4:2]
|
del l[0:4:2]
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
categories: Types,list
|
categories: Types,list
|
||||||
description: List store with step != 1 not implemented
|
description: List store with step != 1 not implemented
|
||||||
cause: Unknown
|
cause: Unknown
|
||||||
workaround: Unknown
|
workaround: Use explicit loop for this rare operation.
|
||||||
"""
|
"""
|
||||||
l = [1, 2, 3, 4]
|
l = [1, 2, 3, 4]
|
||||||
l[0:4:2] = [5, 6]
|
l[0:4:2] = [5, 6]
|
||||||
|
Loading…
Reference in New Issue
Block a user