-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
support bytearray as auto encoding string type
--HG-- rename : tests/run/str_ascii_auto_encoding.pyx => tests/run/bytearray_ascii_auto_encoding.pyx rename : tests/run/str_default_auto_encoding.pyx => tests/run/bytearray_default_auto_encoding.pyx
- Loading branch information
Showing
8 changed files
with
65 additions
and
11 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#cython: c_string_type = bytearray | ||
#cython: c_string_encoding = ascii | ||
|
||
"End of first directives" | ||
|
||
include "unicode_ascii_auto_encoding.pyx" | ||
|
||
auto_string_type = bytearray | ||
|
||
def check_auto_string_type(): | ||
""" | ||
>>> check_auto_string_type() | ||
""" | ||
assert auto_string_type is bytearray |
This file contains 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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# cython: c_string_type = bytearray | ||
# cython: c_string_encoding = default | ||
|
||
import sys | ||
if sys.version_info[0] >= 3: | ||
__doc__ = r""" | ||
>>> isinstance(as_objects("ab\xff"), bytearray) | ||
True | ||
>>> as_objects("ab\xff") == bytearray("ab\xff".encode()) | ||
True | ||
>>> isinstance(slice_as_objects("ab\xff", 1, 4), bytearray) | ||
True | ||
>>> slice_as_objects("ab\xffd", 1, 4) == bytearray("b\xff".encode()) | ||
True | ||
""" | ||
|
||
include "bytearray_ascii_auto_encoding.pyx" |
This file contains 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