forked from PythonCharmers/python-future
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlessons.txt
More file actions
36 lines (23 loc) · 878 Bytes
/
lessons.txt
File metadata and controls
36 lines (23 loc) · 878 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
Comment to add to prevent Pylint from issuing warnings on ``from
future.builtins import *``:
# pylint: disable=W0622,W0401
INCOMPATIBLE: array.array()
Python 2:
>>> array.array(b'b')
array.array(b'b')
>>> array.array(u'u')
TypeError: must be char, not unicode
Python 3:
>>> array.array(b'b')
TypeError: must be a unicode character, not bytes
>>> array.array(u'b')
array('b')
Maybe use on Py2:
>>> array.array(u'b'.encode('ascii')) ??
Long int syntax (e.g. 1000000L) is incompatible with Py3.
We probably shouldn't shadow int with long on Py2 because then isinstance(1, int) is False
Python 2's bytes object is nothing like Python 3's bytes object!
Running test_bytes.py from Py3 on Py2 (after fixing imports) gives this:
--------------------------------------------------------------
Ran 203 tests in 0.209s
FAILED (failures=31, errors=55, skipped=1)