mirror of
https://github.com/kennethreitz/dive-into-python3.git
synced 2026-06-05 23:10:17 +00:00
2 more complete sections and 2 more partial sections in case-study
This commit is contained in:
@@ -10,11 +10,9 @@
|
||||
import sys
|
||||
* test.py: change file() to open()
|
||||
* universaldetector.py: change r'' strings to b'' byte arrays in self._highBitDetector, self._escDetector regular expressions
|
||||
- charsetprober.py: change regular expression-based replace to use b'' byte arrays instead of strings
|
||||
|
||||
- universaldetector.py: change self._mLastChar from a r'' string to a b'' byte array
|
||||
- mbcharsetprober.py: change self._mLastChar from a list of two 1-character strings to a list of two ints
|
||||
- universaldetector.py: getting a single element from a byte array yields an integer, not a byte, so change syntax to make sure we self._mLastChar is always a byte
|
||||
* universaldetector.py: change self._mLastChar from a '' string to a b'' byte array
|
||||
* universaldetector.py: getting a single element from a byte array yields an integer, not a byte, so change syntax to make sure we self._mLastChar is always a byte
|
||||
old:
|
||||
self._mLastChar = aBuf[-1]
|
||||
new:
|
||||
@@ -25,4 +23,8 @@
|
||||
- jpcntx.py, chardistribution.py (editorial): global search-and-replace "aStr" --> "aBuf" to make it clear that we're passing around a byte array
|
||||
- sbcharsetprober.py, latin1prober.py: change ord(c) to c since it's already an int (iterating through a byte array)
|
||||
|
||||
- (not sure where this fits) mbcharsetprober.py: change self._mLastChar from a list of two 1-character strings to a list of two ints
|
||||
|
||||
- (not sure where this fits) charsetprober.py: change regular expression-based replace to use b'' byte arrays instead of strings
|
||||
|
||||
- latin1prober.py: refactor reduce(operator.add, ...) to use a for loop instead
|
||||
|
||||
Reference in New Issue
Block a user