Skip to content

Commit 85d4a5a

Browse files
committed
Set binding=False
This makes code faster and smaller, at the expense of disallowing overriding Cython class methods.
1 parent abf2f76 commit 85d4a5a

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

setup.py

+10-12
Original file line numberDiff line numberDiff line change
@@ -188,15 +188,18 @@ def parse_cflags(raw_flags):
188188
library_dirs=extension_extra["library_dirs"],
189189
)
190190

191+
compiler_directives = {
192+
"c_string_type": "str",
193+
"c_string_encoding": "ascii",
194+
"embedsignature": True,
195+
"binding": False,
196+
"language_level": 3,
197+
}
198+
191199
# Add the cythonized loudnorm extension to ext_modules
192200
ext_modules = cythonize(
193201
loudnorm_extension,
194-
compiler_directives={
195-
"c_string_type": "str",
196-
"c_string_encoding": "ascii",
197-
"embedsignature": True,
198-
"language_level": 3,
199-
},
202+
compiler_directives=compiler_directives,
200203
build_dir="src",
201204
include_path=["include"],
202205
)
@@ -223,12 +226,7 @@ def parse_cflags(raw_flags):
223226
library_dirs=extension_extra["library_dirs"],
224227
sources=[pyx_path],
225228
),
226-
compiler_directives={
227-
"c_string_type": "str",
228-
"c_string_encoding": "ascii",
229-
"embedsignature": True,
230-
"language_level": 3,
231-
},
229+
compiler_directives=compiler_directives,
232230
build_dir="src",
233231
include_path=["include"],
234232
)

0 commit comments

Comments
 (0)