From 9b08f2ffba0233ae8d4d764c1a8f085e7a2c28fa Mon Sep 17 00:00:00 2001 From: "ggellner@encolpuis" Date: Sat, 27 Sep 2008 17:09:25 -0400 Subject: [PATCH] Updated pyrex differences and limitations to better reflect current Cython --- docs/limitations.rst | 4 ---- docs/pyrex_differences.rst | 15 ++++++++++++++- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/docs/limitations.rst b/docs/limitations.rst index 363528d2..a4f82eea 100644 --- a/docs/limitations.rst +++ b/docs/limitations.rst @@ -77,10 +77,6 @@ Other Current Limitations * The :func:`globals` and :func:`locals` functions cannot be used. * Class and function definitions cannot be placed inside control structures. -* Special methods of extension types cannot have functioning docstrings. -* The use of string literals as comments is not recommended at present, - because Cython doesn't optimize them away, and won't even accept them in places - where executable statements are not allowed. Semantic differences between Python and Cython ---------------------------------------------- diff --git a/docs/pyrex_differences.rst b/docs/pyrex_differences.rst index fd471058..2478b5ff 100644 --- a/docs/pyrex_differences.rst +++ b/docs/pyrex_differences.rst @@ -77,6 +77,8 @@ yields:: 4 6 8 + +.. note:: see :ref:`automatic-range-conversion` Boolean int type (e.g. it acts like a c int, but coerces to/from python as a boolean) @@ -168,7 +170,9 @@ of step) can be determined. This may change the semantics if the range causes assignment to ``i`` to overflow. Specifically, if this option is set, an error will be raised before the loop is entered, whereas without this option the loop - will execute until a overflowing value is encountered. + will execute until a overflowing value is encountered. If this effects you + change ``Cython/Compiler/Options.py`` (eventually there will be a better + way to set this). More friendly type casting -------------------------- @@ -260,3 +264,12 @@ file with an encoding comment and generally write your source code in UTF-8. This impacts the encoding of byte strings and the conversion of unicode string literals like ``u'abcd'`` to unicode objects. +Automatic ``typecheck`` +======================== + +Rather than introducing a new keyword :keyword:`typecheck` as explained in the +`Pyrex docs +`_, +Cython emits a (non-spoofable and faster) typecheck whenever +:func:`isinstance` is used with an extension type as the second parameter. + -- 2.26.2