diff options
author | scoder <stefan_ml@behnel.de> | 2018-09-24 22:21:53 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-24 22:21:53 +0200 |
commit | cf7b60ff6814ce8faf7fab2990c423452faa2f0a (patch) | |
tree | 3039d1f414806cb5b644612ae7308ee1ac81c177 /Cython/Compiler/Options.py | |
parent | b6509bf791bfe44abbbaa957ae530e5910815dfd (diff) | |
parent | cea42915c5e9ea1da9187aa3c55f3f16d04ba1e3 (diff) | |
download | cython-0.29rc1.tar.gz |
Merge pull request #2625 from cython/str_is_str_gh25650.29rc1
Add a new directive 'str_is_str=True'
Diffstat (limited to 'Cython/Compiler/Options.py')
-rw-r--r-- | Cython/Compiler/Options.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Cython/Compiler/Options.py b/Cython/Compiler/Options.py index a113f7182..966d282ed 100644 --- a/Cython/Compiler/Options.py +++ b/Cython/Compiler/Options.py @@ -198,6 +198,7 @@ _directive_defaults = { 'iterable_coroutine': False, # Make async coroutines backwards compatible with the old asyncio yield-from syntax. 'c_string_type': 'bytes', 'c_string_encoding': '', + 'str_is_str': None, # fall back to 'language_level == 2' 'type_version_tag': True, # enables Py_TPFLAGS_HAVE_VERSION_TAG on extension types 'unraisable_tracebacks': True, 'old_style_globals': False, @@ -313,6 +314,7 @@ directive_types = { 'freelist': int, 'c_string_type': one_of('bytes', 'bytearray', 'str', 'unicode'), 'c_string_encoding': normalise_encoding_name, + 'str_is_str': bool, } for key, val in _directive_defaults.items(): @@ -347,6 +349,7 @@ directive_scopes = { # defaults to available everywhere # Avoid scope-specific to/from_py_functions for c_string. 'c_string_type': ('module',), 'c_string_encoding': ('module',), + 'str_is_str': ('module',), 'type_version_tag': ('module', 'cclass'), 'language_level': ('module',), # globals() could conceivably be controlled at a finer granularity, |