Limitations

This page used to list bugs in Cython that made the semantics ofcompiled code differ from that in Python. Most of the missingfeatures have been fixed in Cython 0.15. A future version ofCython is planned to provide full Python language compatibility.For now, the issue tracker can provide an overview of deviationsthat we are aware of and would like to see fixed.

https://github.com/cython/cython/labels/Python%20Semantics

Below is a list of differences that we will probably not be addressing.Most of these things that fall more into the implementation details ratherthan semantics, and we may decide not to fix (or require a –pedantic flag to get).

Nested tuple argument unpacking

  1. def f((a,b), c):
  2. pass

This was removed in Python 3.

Inspect support

While it is quite possible to emulate the interface of functions inCython’s own function type, and recent Cython releases have seen severalimprovements here, the “inspect” module does not consider a Cythonimplemented function a “function”, because it tests the object typeexplicitly instead of comparing an abstract interface or an abstractbase class. This has a negative impact on code that uses inspect toinspect function objects, but would require a change to Python itself.

Stack frames

Currently we generate fake tracebacks as part of exception propagation,but don’t fill in locals and can’t fill in co_code.To be fully compatible, we would have to generate these stack frame objects atfunction call time (with a potential performance penalty). We may have anoption to enable this for debugging.

Identity vs. equality for inferred literals

  1. a = 1.0 # a inferred to be C type 'double'
  2. b = c = None # b and c inferred to be type 'object'
  3. if some_runtime_expression:
  4. b = a # creates a new Python float object
  5. c = a # creates a new Python float object
  6. print(b is c) # most likely not the same object