PyPI / cython / 3.3.1

cython 3.3.1

Source
https://github.com/cython/cython
Artifact scanned
cython-3.3.1-py3-none-any.whl (wheel · 1.3 MB · SHA-256 61abc7feedd2…)
Compared with
cython-3.3.0-py3-none-any.whl (0 signals introduced since)
Files
161 scanned, 160 skipped (binary, oversized, or unrecognised)
Signals
0 critical · 0 warn · 26 info
Scan time
19.4 s
LLM review
Reviewed by claude-haiku-5-5 (Anthropic): 25 of 25 warn and critical signals; 25 demoted to info.
Disclude version
4.3.0
Scanned (UTC)
2026-11-01 20:27

Signals

Ordered by severity, then signals introduced in this release. Hidden characters are shown as ⟨U+…⟩.

  1. info warn → info by review frame-introspection Cython/Build/Inline.py:125:33

    `inspect.currentframe` — call-stack frame introspection (ast pass, confidence 0.70)

                if locals is None or globals is None:
                    calling_frame = inspect.currentframe().f_back.f_back.f_back
                    if locals is None:
                        locals = calling_frame.f_locals
    likely benign LLM, confidence 0.95 Cython inline() reads the calling frame's locals and globals when not supplied.
    Reasoning

    Walking caller frames to read locals/globals is the standard way Cython's inline() picks up the calling namespace when none is given; no exfiltration or hidden behavior visible.

  2. info warn → info by review frame-introspection Cython/Build/Inline.py:181:18

    `inspect.currentframe` — call-stack frame introspection (ast pass, confidence 0.70)

        if locals is None:
            locals = inspect.currentframe().f_back.f_back.f_locals
        if globals is None:
            globals = inspect.currentframe().f_back.f_back.f_globals
    likely benign LLM, confidence 0.95 Cython inline() defaults namespaces from the calling frame.
    Reasoning

    Same legitimate pattern: fetching caller f_locals/f_globals as defaults for the inline compilation namespace.

  3. info warn → info by review frame-introspection Cython/Build/Inline.py:183:19

    `inspect.currentframe` — call-stack frame introspection (ast pass, confidence 0.70)

        if globals is None:
            globals = inspect.currentframe().f_back.f_back.f_globals
        try:
            _cython_inline_cache[orig_code] = _unbound_symbols = unbound_symbols(code)
    likely benign LLM, confidence 0.93 Cython inline() fills in globals from the caller and caches unbound symbols.
    Reasoning

    Frame-based globals lookup feeding an unbound-symbols cache for inline code; consistent with Cython's inline helper and not malicious.

  4. info critical → info by review dynamic-import Cython/Build/Inline.py:329:24

    `__import__` called on a non-literal expression (ast pass, confidence 0.70)

    
        module_namespace = __import__(import_module).__dict__ if import_module else None
    
        cymeit_code = _CYMEIT_TEMPLATE.format(
    likely benign LLM, confidence 0.93 cymeit helper imports an optional user-named module to expose its namespace.
    Reasoning

    Imports a user-specified module name for cymeit benchmarking to access its namespace; the import target is caller-controlled module configuration in a developer tool, not a hidden payload.

  5. info critical → info by review dynamic-import Cython/Build/IpythonMagic.py:167:13

    `__import__` called on a non-literal expression (ast pass, confidence 0.70)

            else:
                __import__(module_name)
                module = sys.modules[module_name]
                self._reloads[module_name] = module
    likely benign LLM, confidence 0.93 Cython IPython magic imports and tracks modules for reload.
    Reasoning

    IPython magic reloads a user-requested module by name after an import, a normal development feature of the Cython %%cython magic.

  6. info critical → info by review builtins-write Cython/Build/Tests/TestIpythonMagic.py:117:21

    `setattr(builtins, ...)` — patches a built-in for every importer of this module (ast pass, confidence 0.95)

                    if getattr(builtins, name, None) is not value:
                        setattr(builtins, name, value)
    
            super().tearDownClass()
    likely benign LLM, confidence 0.85 Test teardown restores builtins modified during IPython magic tests.
    Reasoning

    In a test tearDownClass the code restores builtins it previously patched; setattr on builtins is confined to test setup/teardown and restores original values.

  7. info warn → info by review dynamic-execution Cython/Compiler/Main.py:867:18

    `compile` called on a non-literal expression (ast pass, confidence 0.70)

    
            result = compile(sources, options)
            if result.num_errors > 0:
                any_failures = 1
    likely benign LLM, confidence 0.90 Cython's Main.compile invokes the Cython compiler on source files.
    Reasoning

    compile here is the Cython compiler's own compile() method on source and options, not Python's builtin exec-style compile; the name collision explains the flag.

  8. info warn → info by review dynamic-attribute Cython/Compiler/Options.py:155:17

    reach-by-name through `globals.get` (ast pass, confidence 0.60)

        for old_option in ShouldBeFromDirective.known_directives:
            value = globals().get(old_option.options_name)
            assert old_option.directive_name in _directive_defaults
            if not isinstance(value, ShouldBeFromDirective):
    likely benign LLM, confidence 0.92 Options module resolves deprecated option names via globals for validation.
    Reasoning

    Looks up legacy option names in the module's globals for deprecation handling of directive-backed options; a plain configuration check.

  9. info warn → info by review decoder-import-with-exec Cython/Debugger/Tests/test_libcython_in_gdb.py:153:21

    file imports decoder module(s) pickle and calls `exec`/`eval`/`compile` — multi-stage payload shape (ast pass, confidence 0.80)

            instance = test_class(*filler_args)
            recreated = eval("libcython." + repr(instance))
            self.assertEqual(pickle.dumps(instance), pickle.dumps(recreated))
    likely benign LLM, confidence 0.85 Debugger test evals repr of test objects to verify pickling.
    Reasoning

    Test round-trips an object via repr and eval to check pickle equality of libcython types; the eval input is a repr of test-controlled objects, a testing idiom rather than a payload.

  10. info critical → info by review dynamic-execution Cython/Debugger/Tests/test_libcython_in_gdb.py:153:21

    `eval` called on a constructed string (ast pass, confidence 0.80)

            instance = test_class(*filler_args)
            recreated = eval("libcython." + repr(instance))
            self.assertEqual(pickle.dumps(instance), pickle.dumps(recreated))
    likely benign LLM, confidence 0.80 Debugger test evaluates a constructed libcython expression for a round-trip check.
    Reasoning

    eval of a constructed string is real, but the string is 'libcython.' plus the repr of locally created test instances in a unit test; benign test code, though eval is a flagged construct.

  11. info critical → info by review frame-introspection Cython/Debugger/Tests/test_libcython_in_gdb.py:531:37

    `sys._getframe` — call-stack frame introspection — file also calls `sys.exit`/`exec`/`eval` (anti-analysis shape) (ast pass, confidence 0.85)

        if _do_debug:
            messages = itertools.chain([sys._getframe(1).f_code.co_name, ':'],
                                       messages)
            _debug_file.write(' '.join(str(msg) for msg in messages) + '\n')
    likely benign LLM, confidence 0.90 Debug helper logs caller function name via frame introspection.
    Reasoning

    Debug-logging helper reads the caller's function name via sys._getframe when a debug flag is set; the anti-analysis note is triggered only by sys.exit elsewhere in the file, not by evasion here.

  12. info critical → info by review dynamic-import Cython/Debugger/Tests/test_libcython_in_gdb.py:545:13

    `__import__` called on a non-literal expression (ast pass, confidence 0.70)

        else:
            m = __import__(modulename, fromlist=[''])
            tests = inspect.getmembers(m, inspect.isclass)
    likely benign LLM, confidence 0.90 Test runner dynamically imports a test module by name and collects test classes.
    Reasoning

    Test runner imports a named test module and collects its classes, a standard unittest discovery pattern.

  13. info warn → info by review frame-introspection Cython/Debugging.py:10:9

    `sys._getframe` — call-stack frame introspection (ast pass, confidence 0.70)

        print(" ".join(map(str, args)))
        f = sys._getframe(1)
        while f:
            name = f.f_code.co_name
    likely benign LLM, confidence 0.92 Cython debug print walks frames to label output with caller names.
    Reasoning

    Debugging helper walks up the stack to print the calling context for Cython's own debug output; standard for a debug utility.

  14. info critical → info by review frame-introspection Cython/Tempita/_tempita.py:129:26

    `sys._getframe` — call-stack frame introspection — file also calls `sys.exit`/`exec`/`eval` (anti-analysis shape) (ast pass, confidence 0.85)

                try:
                    caller = sys._getframe(stacklevel)
                except ValueError:
                    pass
    likely benign LLM, confidence 0.90 Tempita templating reads a caller frame to resolve template context.
    Reasoning

    Tempita template engine fetches the caller frame at a given stacklevel to resolve template namespaces; a standard templating feature, with exception handling for shallow stacks.

  15. info warn → info by review dynamic-execution Cython/Tempita/_tempita.py:307:25

    `eval` called on a non-literal expression (ast pass, confidence 0.70)

                try:
                    value = eval(code, self.default_namespace, ns)
                except SyntaxError as e:
                    raise SyntaxError(
    likely benign LLM, confidence 0.85 Tempita's template expression evaluator calls eval on the expression text inside a template.
    Reasoning

    Tempita is a templating engine that evaluates template expressions by design, using a restricted namespace. The eval is the engine's core function, not a hidden payload. The file is a vendored copy of a well-known library.

  16. info warn → info by review dynamic-execution Cython/Tempita/_tempita.py:323:13

    `exec` called on a non-literal expression (ast pass, confidence 0.70)

            try:
                exec(code, self.default_namespace, ns)
            except Exception as e:
                if e.args:
    likely benign LLM, confidence 0.85 Tempita executes template statement code via exec in a supplied namespace.
    Reasoning

    This exec runs compiled template code in the engine's own namespace, which is how Tempita implements template logic. Nothing in the snippet shows attacker-controlled input reaching it from outside the template being rendered.

  17. info warn → info by review dynamic-execution Cython/Tempita/_tempita.py:1070:21

    `eval` called on a non-literal expression (ast pass, confidence 0.70)

                name = name[:3]
                value = eval(value)
            vars[name] = value
        if template_name == '-':
    likely benign LLM, confidence 0.80 The Tempita command-line tool evals a variable value supplied on the command line.
    Reasoning

    This is the command-line handler for Tempita, which evals user-supplied variable values passed with -D options. That is an explicit developer-facing feature run by the person invoking the tool, not a stealth dropper.

  18. info warn → info by review implicit-int-function Cython/Utility/Builtins.c:303:77

    8 functions in this file lack an explicit return type (pre-ANSI K&R style; e.g. a, a, b, a, a, b) (ast pass, confidence 0.85)

    
    static CYTHON_INLINE {{RETURN_TYPE}} __Pyx_divmod_{{CFUNC_SUFFIX}}({{TYPE}} a, {{TYPE}} b); /*proto*/
    dismissed LLM, confidence 0.92 Cython C utility template declaring divmod helper prototypes with templated return types.
    Reasoning

    The snippet is a Cython utility template with {{...}} placeholders. The 'implicit int' heuristic is misfiring on template text where the return type is substituted at code generation, so the real C functions do have return types.

  19. info identifier-low-length Cython/Utility/CMath.c:1:1

    101 of 228 non-conventional identifiers are single-character (44%) (token pass, confidence 0.50)

  20. info warn → info by review implicit-int-function Cython/Utility/Complex.c:117:74

    17 functions in this file lack an explicit return type (pre-ANSI K&R style; e.g. x, y, x, y, a, b) (ast pass, confidence 0.85)

      #else
        static CYTHON_INLINE {{type}} {{type_name}}_from_parts({{real_type}} x, {{real_type}} y) {
          return x + y*({{type}})_Complex_I;
        }
    dismissed LLM, confidence 0.92 Cython complex-number helper template that builds a complex value from real and imaginary parts.
    Reasoning

    The flagged function uses a templated return type {{type}} and templated parameter types, which is standard Cython code generation. It is not legacy K&R C.

  21. info warn → info by review implicit-int-function Cython/Utility/ExtensionTypes.c:660:45

    5 functions in this file lack an explicit return type (pre-ANSI K&R style; e.g. _maybe_call_slot, vectorcallfunc, AsVectorcall, ret_type, AsVectorcall) (ast pass, confidence 0.85)

    
    static CYTHON_INLINE PyObject *{{func_name}}_maybe_call_slot(PyTypeObject* type, PyObject *left, PyObject *right {{extra_arg_decl}}) {
        {{slot_type}} slot;
    #if CYTHON_USE_TYPE_SLOTS
    dismissed LLM, confidence 0.92 Cython extension-type slot-dispatch template for binary operators.
    Reasoning

    The function signature uses template placeholders such as {{func_name}} and {{slot_type}}, so the heuristic flagged generated-code text. The surrounding code is ordinary CPython extension-type dispatch.

  22. info warn → info by review implicit-int-function Cython/Utility/MemoryView_C.c:819:8

    8 functions in this file lack an explicit return type (pre-ANSI K&R style; e.g. shape, shape, strides, strides, suboffsets, suboffsets) (ast pass, confidence 0.85)

    
    {{dst}}.shape[{{new_ndim}}] = {{src}}.shape[{{dim}}];
    {{dst}}.strides[{{new_ndim}}] = {{src}}.strides[{{dim}}];
    dismissed LLM, confidence 0.92 Cython memoryview template copying shape, stride and suboffset arrays between views.
    Reasoning

    The matches are plain assignments to struct members with templated indices, copying shape and stride arrays. This is ordinary memoryview code, and the implicit-int hit comes from the template syntax.

  23. info warn → info by review implicit-int-function Cython/Utility/Optimize.c:1232:3

    18 functions in this file lack an explicit return type (pre-ANSI K&R style; e.g. in, type1, Bool, iop2, float_op2, float_op2) (ast pass, confidence 0.85)

    
    {{if c_op in '+-*'}}
    
    {{if type1 in ('object', 'float')}}
    dismissed LLM, confidence 0.92 Cython optimizer template with conditional blocks that generate arithmetic fast paths.
    Reasoning

    The snippet is Cython Tempita-style conditional directives such as {{if ...}} that select code by operator and type. The flagged names come from template variables, not missing C return types.

  24. info warn → info by review implicit-int-function Cython/Utility/Overflow.c:67:77

    42 functions in this file lack an explicit return type (pre-ANSI K&R style; e.g. a, a, a, a, a, a) (ast pass, confidence 0.85)

    
    static CYTHON_INLINE {{UINT}} __Pyx_add_{{NAME}}_checking_overflow({{UINT}} a, {{UINT}} b, int *overflow);
    static CYTHON_INLINE {{UINT}} __Pyx_sub_{{NAME}}_checking_overflow({{UINT}} a, {{UINT}} b, int *overflow);
    dismissed LLM, confidence 0.92 Cython overflow-checking arithmetic helper prototypes generated for each integer type.
    Reasoning

    These are prototypes for overflow-checking arithmetic helpers, with the type name and return type substituted from {{UINT}} and {{NAME}} placeholders. The implicit-int warning is a false positive on the template source.

  25. info warn → info by review macro-keyword-override Cython/Utility/Synchronization.c:14:1

    `#define __pyx_atomic_int_type int` aliases a C reserved keyword behind a non-keyword macro name (ast pass, confidence 0.85)

    
    #define __pyx_atomic_int_type int
    #define __pyx_nonatomic_int_type int
    likely benign LLM, confidence 0.90 Macro aliasing the internal atomic integer type name to int for the non-atomic fallback.
    Reasoning

    Mapping an internal type name to int through a macro is a standard portability technique for choosing between atomic and non-atomic integer types. It is not a keyword hijack or a sign of obfuscation, and the context is a plain C header.

  26. info warn → info by review macro-keyword-override Cython/Utility/Synchronization.c:15:1

    `#define __pyx_nonatomic_int_type int` aliases a C reserved keyword behind a non-keyword macro name (ast pass, confidence 0.85)

    #define __pyx_atomic_int_type int
    #define __pyx_nonatomic_int_type int
    
    // For standard C/C++ atomics, get the headers first so we have ATOMIC_INT_LOCK_FREE
    likely benign LLM, confidence 0.90 Macro aliasing the non-atomic integer type name to int in Cython's synchronization utilities.
    Reasoning

    This is the companion macro that aliases the non-atomic integer type to int. It is the same portability pattern as the adjacent definition, with no sign of concealed behaviour.

Reproduce This Scan

Run disclude locally to verify. These commands scan the published file; the "new in this release" marks come from comparing it with the previous release's file, which they don't repeat. Add --format sarif for SARIF output. Add --llm (with an API key in the environment) to include the LLM review.

cargo install disclude --version 4.3.0
curl -fsSL -o cython-3.3.1-py3-none-any.whl https://files.pythonhosted.org/packages/9d/55/088578d75bc8dbcbc535af04b1d596ff227ca756dd74f9d3c1c526f955d0/cython-3.3.1-py3-none-any.whl
printf '%s  %s\n' 61abc7feedd20dac6c4ff7ab3a30e17136a067b242ab9253e2b4a6d9a72c2b61 cython-3.3.1-py3-none-any.whl | shasum -a 256 -c -
unzip -q cython-3.3.1-py3-none-any.whl -d pkg
disclude scan --untrusted --severity info pkg