scoder

Results 650 comments of scoder

A caveat is that Cython currently requires exact types for builtin type declarations, so if you write `list[str]`, then the code might fail if subtypes of `str` occur in the...

> ```cython > cdef dict d = {1.1: 1} > cdef float i > for i in d: > print(d[i[) > ``` I consider this a bug on user side....

> ```python > x: list[cython.int] = [1, 2, 3] > xx: list[cython.int] = x # This is OK > y: list = x # This is OK > z: list[float]...

There was prior discussion on this topic in https://github.com/cython/cython/issues/1979

Related to: https://github.com/cython/cython/issues/3873 https://github.com/cython/cython/issues/3150

It's because you are not using (Python) type annotations at all. You are writing Cython type declarations into your code. Those are not Python type annotations.

Cython is somewhat relaxed when it comes to object types. We often just say "if it's a Python object, then an object operation on it is probably ok", rather than...

Thanks for the report. It's always a tradeoff how much error information we can present in one run and where to stop. Here, it continues after reporting the error that...

Related to, if not a duplicate of, #2117. The potential gain is likely small, but it would avoid a tuple creation for non-constant values. I don't really see an advantage...

This is partly implemented in https://github.com/cython/cython/pull/6926, but only for C item types, not Python item types.