CHANGES.rst 126 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600
  1. ================
  2. Cython Changelog
  3. ================
  4. 0.29.37 (2023-12-18)
  5. ====================
  6. Bugs fixed
  7. ----------
  8. * Fix a potential crash while cleaning up subtypes of externally imported extension
  9. types when terminating Python. This was introduced in Cython 0.29.35.
  10. * Fix a ``complex`` related compile error on Windows.
  11. (Github issue :issue:`5512`)
  12. * Compiling fused types used in pxd files could crash Cython in Python 3.11+.
  13. (Github issues :issue:`5894`, :issue:`5588`)
  14. * ``cythonize`` failed to consider the ``CYTHON_FORCE_REGEN`` env variable.
  15. Patch by Harmen Stoppels. (Github issue :issue:`5712`)
  16. 0.29.36 (2023-07-04)
  17. ====================
  18. Bugs fixed
  19. ----------
  20. * Async generators lost their return value in PyPy.
  21. (Github issue :issue:`5465`)
  22. * The outdated C macro ``_PyGC_FINALIZED()`` is no longer used in Py3.9+.
  23. * The deprecated ``Py_OptimizeFlag`` is no longer used in Python 3.9+.
  24. (Github issue :issue:`5343`)
  25. * Using the global ``__debug__`` variable but not assertions could lead to compile errors.
  26. * The broken HTML template support was removed from Tempita.
  27. (Github issue :issue:`3309`)
  28. 0.29.35 (2023-05-24)
  29. ====================
  30. Bugs fixed
  31. ----------
  32. * A garbage collection enabled subtype of a non-GC extension type could call into the
  33. deallocation function of the super type with GC tracking enabled. This could lead
  34. to crashes during deallocation if GC was triggered on the type at the same time.
  35. (Github issue :issue:`5432`)
  36. * Some C compile failures and crashes in CPython 3.12 were resolved.
  37. * ``except + nogil`` was syntactically not allowed.
  38. ``except +nogil`` (i.e. defining a C++ exception handling function called ``nogil``)
  39. is now disallowed to prevent typos.
  40. (Github issue :issue:`5430`)
  41. * A C compile failure in PyPy 3.10 was resolved.
  42. Patch by Matti Picus. (Github issue :issue:`5408`)
  43. * Cython modules now use PEP-489 multi-phase init by default in PyPy 3.9 and later.
  44. Original patch by Matti Picus. (Github issue :issue:`5413`)
  45. * API header files generated by different Cython versions can now be included in the
  46. same C file.
  47. (Github issue :issue:`5383`)
  48. * Function signatures containing a type like `tuple[()]` could not be printed.
  49. Patch by Lisandro Dalcin. (Github issue :issue:`5355`)
  50. 0.29.34 (2023-04-02)
  51. ====================
  52. Bugs fixed
  53. ----------
  54. * A refence leak of the for-loop list/tuple iterable was resolved if the for-loop's
  55. ``else:`` branch executes a ``break`` for an outer loop.
  56. (Github issue :issue:`5347`)
  57. * Some C compile failures in CPython 3.12 were resolved.
  58. * Some old usages of the deprecated Python ``imp`` module were replaced with ``importlib``.
  59. Patch by Matúš Valo. (Github issue :issue:`5300`)
  60. * Some issues with ``depfile`` generation were resolved.
  61. Patches by Eli Schwartz. (Github issues :issue:`5279`, :issue:`5291`)
  62. 0.29.33 (2023-01-06)
  63. ====================
  64. Features added
  65. --------------
  66. * The ``cythonize`` and ``cython`` commands have a new option ``-M`` / ``--depfile``
  67. to generate ``.dep`` dependency files for the compilation unit. This can be used
  68. by external build tools to track these dependencies.
  69. The ``cythonize`` option was already available in Cython :ref:`0.29.27`.
  70. Patches by Evgeni Burovski and Eli Schwartz. (Github issue :issue:`1214`)
  71. Bugs fixed
  72. ----------
  73. * ``const`` fused types could not be used with memory views.
  74. Patch by Thomas Vincent. (Github issue :issue:`1772`)
  75. * ``wstr`` usage was removed in Python 3.12 and later (PEP-623).
  76. (Github issue :issue:`5145`)
  77. * A type check assertion for Cython functions failed in debug Python builds.
  78. (Github issue :issue:`5031`)
  79. * Fixed various compiler warnings.
  80. Patches by Lisandro Dalcin et al. (Github issues :issue:`4948`, :issue:`5086`)
  81. * Fixed error when calculating complex powers of negative numbers.
  82. (Github issue :issue:`5014`)
  83. * Corrected a small mis-formatting of exception messages on Python 2.
  84. (Github issue :issue:`5018`)
  85. * The ``PyUnicode_AsUTF8AndSize()`` C-API function was missing from the CPython declarations.
  86. (Github issue :issue:`5163`)
  87. * A performance problem in the compiler was resolved when nesting conditional expressions.
  88. (Github issue :issue:`5197`)
  89. * Test suite problems with recent NumPy and CPython versions were resolved.
  90. (Github issues :issue:`5183`, :issue:`5190`)
  91. Other changes
  92. -------------
  93. * The undocumented, untested and apparently useless syntax
  94. ``from somemodule cimport class/struct/union somename`` was deprecated
  95. in anticipation of its removal in Cython 3. The type
  96. modifier is not needed here and a plain ``cimport`` of the name will do.
  97. (Github issue :issue:`4905`)
  98. * Properly disable generation of descriptor docstrings on PyPy since they cause crashes.
  99. It was previously disabled, but only accidentally via a typo.
  100. Patch by Matti Picus. (Github issue :issue:`5083`)
  101. * The ``cpow`` directive of Cython 3.0 is available as a no-op.
  102. (Github issue :issue:`5016`)
  103. 0.29.32 (2022-07-29)
  104. ====================
  105. Bugs fixed
  106. ----------
  107. * Revert "Using memoryview typed arguments in inner functions is now rejected as unsupported."
  108. Patch by David Woods. (Github issue #4798)
  109. * ``from module import *`` failed in 0.29.31 when using memoryviews.
  110. Patch by David Woods. (Github issue #4927)
  111. 0.29.31 (2022-07-27)
  112. ====================
  113. Features added
  114. --------------
  115. * A new argument ``--module-name`` was added to the ``cython`` command to
  116. provide the (one) exact target module name from the command line.
  117. Patch by Matthew Brett and h-vetinari. (Github issue #4906)
  118. * A new keyword ``noexcept`` was added for forward compatibility with Cython 3.
  119. Patch by David Woods. (Github issue #4903)
  120. Bugs fixed
  121. ----------
  122. * Use ``importlib.util.find_spec()`` instead of the deprecated ``importlib.find_loader()``
  123. function when setting up the package path at import-time.
  124. Patch by Matti Picus. (Github issue #4764)
  125. * Require the C compiler to support the two-arg form of ``va_start``
  126. on Python 3.10 and higher.
  127. Patch by Thomas Caswell. (Github issue #4820)
  128. * Make ``fused_type`` subscriptable in Shadow.py.
  129. Patch by Pfebrer. (Github issue #4842)
  130. * Fix the incorrect code generation of the target type in ``bytearray`` loops.
  131. Patch by Kenrick Everett. (Github issue #4108)
  132. * Atomic refcounts for memoryviews were not used on some GCC versions by accident.
  133. Patch by Sam Gross. (Github issue #4915)
  134. * Silence some GCC ``-Wconversion`` warnings in C utility code.
  135. Patch by Lisandro Dalcin. (Github issue #4854)
  136. * Tuple multiplication was ignored in expressions such as ``[*(1,) * 2]``.
  137. Patch by David Woods. (Github issue #4864)
  138. * Calling ``append`` methods on extension types could fail to find the method
  139. in some cases.
  140. Patch by David Woods. (Github issue #4828)
  141. * Ensure that object buffers (e.g. ``ndarray[object, ndim=1]``) containing
  142. ``NULL`` pointers are safe to use, returning ``None`` instead of the ``NULL``
  143. pointer.
  144. Patch by Sebastian Berg. (Github issue #4859)
  145. * Using memoryview typed arguments in inner functions is now rejected as unsupported.
  146. Patch by David Woods. (Github issue #4798)
  147. * Compilation could fail on systems (e.g. FIPS) that block MD5 checksums at runtime.
  148. (Github issue #4909)
  149. * Experimental adaptations for the CPython "nogil" fork was added.
  150. Note that there is no official support for this in Cython 0.x.
  151. Patch by Sam Gross. (Github issue #4912)
  152. 0.29.30 (2022-05-16)
  153. ====================
  154. Bugs fixed
  155. ----------
  156. * The GIL handling changes in 0.29.29 introduced a regression where
  157. objects could be deallocated without holding the GIL.
  158. (Github issue #4796)
  159. 0.29.29 (2022-05-16)
  160. ====================
  161. Features added
  162. --------------
  163. * Avoid acquiring the GIL at the end of nogil functions.
  164. This change was backported in order to avoid generating wrong C code
  165. that would trigger C compiler warnings with tracing support enabled.
  166. Backport by Oleksandr Pavlyk. (Github issue #4637)
  167. Bugs fixed
  168. ----------
  169. * Function definitions in ``finally:`` clauses were not correctly generated.
  170. Patch by David Woods. (Github issue #4651)
  171. * A case where C-API functions could be called with a live exception set was fixed.
  172. Patch by Jakub Kulík. (Github issue #4722)
  173. * Pickles can now be exchanged again with those generated from Cython 3.0 modules.
  174. (Github issue #4680)
  175. * Cython now correctly generates Python methods for both the provided regular and
  176. reversed special numeric methods of extension types.
  177. Patch by David Woods. (Github issue #4750)
  178. * Calling unbound extension type methods without arguments could raise an
  179. ``IndexError`` instead of a ``TypeError``.
  180. Patch by David Woods. (Github issue #4779)
  181. * Calling unbound ``.__contains__()`` super class methods on some builtin base
  182. types could trigger an infinite recursion.
  183. Patch by David Woods. (Github issue #4785)
  184. * The C union type in pure Python mode mishandled some field names.
  185. Patch by Jordan Brière. (Github issue #4727)
  186. * Allow users to overwrite the C macro ``_USE_MATH_DEFINES``.
  187. Patch by Yuriy Chernyshov. (Github issue #4690)
  188. * Improved compatibility with CPython 3.10/11.
  189. Patches by Thomas Caswell, David Woods. (Github issues #4609, #4667, #4721, #4730, #4777)
  190. * Docstrings of descriptors are now provided in PyPy 7.3.9.
  191. Patch by Matti Picus. (Github issue #4701)
  192. 0.29.28 (2022-02-17)
  193. ====================
  194. Bugs fixed
  195. ----------
  196. * Due to backwards incompatible changes in CPython 3.11a4, the feature flags
  197. ``CYTHON_FAST_THREAD_STATE`` and ``CYTHON_USE_EXC_INFO_STACK`` are now disabled
  198. in Python 3.11 and later. They are enabled again in Cython 3.0.
  199. Patch by David Woods. (Github issue #4610)
  200. * A C compiler warning in older PyPy versions was resolved.
  201. Patch by Matti Picus. (Github issue #4236)
  202. 0.29.27 (2022-01-28)
  203. ====================
  204. Features added
  205. --------------
  206. * The ``cythonize`` command has a new option ``-M`` to generate ``.dep`` dependency
  207. files for the compilation unit. This can be used by external build tools to track
  208. these dependencies.
  209. Patch by Evgeni Burovski. (Github issue #1214)
  210. Bugs fixed
  211. ----------
  212. * Compilation failures on PyPy were resolved.
  213. Patches by Matti Picus. (Github issues #4509, #4517)
  214. * Calls to ``range()`` with more than three arguments did not fail.
  215. Original patch by Max Bachmann. (Github issue #4550)
  216. * Some C compiler warnings about missing type struct initialisers in Py3.10 were resolved.
  217. * Cython no longer warns about using OpenMP 3.0 features since they are now
  218. considered generally available.
  219. 0.29.26 (2021-12-16)
  220. ====================
  221. Bugs fixed
  222. ----------
  223. * An incompatibility with CPython 3.11.0a3 was resolved.
  224. (Github issue #4499)
  225. * The ``in`` operator failed on literal lists with starred expressions.
  226. Patch by Arvind Natarajan. (Github issue #3938)
  227. * A C compiler warning in PyPy about a missing struct field initialisation was resolved.
  228. 0.29.25 (2021-12-06)
  229. ====================
  230. Bugs fixed
  231. ----------
  232. * Several incompatibilities with CPython 3.11 were resolved.
  233. Patches by David Woods, Victor Stinner, Thomas Caswell.
  234. (Github issues #4411, #4414, #4415, #4416, #4420, #4428, #4473, #4479, #4480)
  235. * Some C compiler warnings were resolved.
  236. Patches by Lisandro Dalcin and others. (Github issue #4439)
  237. * C++ ``std::move()`` should only be used automatically in MSVC versions that support it.
  238. Patch by Max Bachmann. (Github issue #4191)
  239. * The ``Py_hash_t`` type failed to accept arbitrary "index" values.
  240. (Github issue #2752)
  241. * Avoid copying unaligned 16-bit values since some platforms require them to be aligned.
  242. Use memcpy() instead to let the C compiler decide how to do it.
  243. (Github issue #4343)
  244. * Cython crashed on invalid truthiness tests on C++ types without ``operator bool``.
  245. Patch by David Woods. (Github issue #4348)
  246. * The declaration of ``PyUnicode_CompareWithASCIIString()`` in ``cpython.unicode`` was incorrect.
  247. Patch by Max Bachmann. (Github issue #4344)
  248. 0.29.24 (2021-07-14)
  249. ====================
  250. Bugs fixed
  251. ----------
  252. * Inline functions in pxd files that used memory views could lead to invalid
  253. C code if the module that imported from them does not use memory views.
  254. Patch by David Woods. (Github issue #1415)
  255. * Several declarations in ``libcpp.string`` were added and corrected.
  256. Patch by Janek Bevendorff. (Github issue #4268)
  257. * Pickling unbound Cython compiled methods failed.
  258. Patch by Pierre Glaser. (Github issue #2972)
  259. * The tracing code was adapted to work with CPython 3.10.
  260. * The optimised ``in`` operator failed on unicode strings in Py3.9 and later
  261. that were constructed from an external ``wchar_t`` source.
  262. Also, related C compiler warnings about deprecated C-API usage were resolved.
  263. (Github issue #3925)
  264. * Some compiler crashes were resolved.
  265. Patch by David Woods. (Github issues #4214, #2811)
  266. * An incorrect warning about 'unused' generator expressions was removed.
  267. (GIthub issue #1699)
  268. * The attributes ``gen.gi_frame`` and ``coro.cr_frame`` of Cython compiled
  269. generators and coroutines now return an actual frame object for introspection,
  270. instead of ``None``.
  271. (Github issue #2306)
  272. 0.29.23 (2021-04-14)
  273. ====================
  274. Bugs fixed
  275. ----------
  276. * Some problems with Python 3.10 were resolved.
  277. Patches by Victor Stinner and David Woods. (Github issues #4046, #4100)
  278. * An incorrect "optimisation" was removed that allowed changes to a keyword
  279. dict to leak into keyword arguments passed into a function.
  280. Patch by Peng Weikang. (Github issue #3227)
  281. * Multiplied str constants could end up as bytes constants with language_level=2.
  282. Patch by Alphadelta14 and David Woods. (Github issue #3951)
  283. * ``PY_SSIZE_T_CLEAN`` does not get defined any more if it is already defined.
  284. Patch by Andrew Jones. (Github issue #4104)
  285. 0.29.22 (2021-02-20)
  286. ====================
  287. Features added
  288. --------------
  289. * Some declarations were added to the provided pxd includes.
  290. Patches by Zackery Spytz and John Kirkham.
  291. (Github issues #3811, #3882, #3899, #3901)
  292. Bugs fixed
  293. ----------
  294. * A crash when calling certain functions in Py3.9 and later was resolved.
  295. (Github issue #3917)
  296. * ``const`` memory views of structs failed to compile.
  297. (Github issue #2251)
  298. * ``const`` template declarations could not be nested.
  299. Patch by Ashwin Srinath. (Github issue #1355)
  300. * The declarations in the ``cpython.pycapsule`` module were missing their
  301. ``const`` modifiers and generated incorrect C code.
  302. Patch by Warren Weckesser. (Github issue #3964)
  303. * Casts to memory views failed for fused dtypes.
  304. Patch by David Woods. (Github issue #3881)
  305. * ``repr()`` was assumed to return ``str`` instead of ``unicode`` with ``language_level=3``.
  306. (Github issue #3736)
  307. * Calling ``cpdef`` functions from cimported modules crashed the compiler.
  308. Patch by David Woods. (Github issue #4000)
  309. * Cython no longer validates the ABI size of the NumPy classes it compiled against.
  310. See the discussion in https://github.com/numpy/numpy/pull/432
  311. * A C compiler warning about enum value casting was resolved in GCC.
  312. (Github issue #2749)
  313. * Coverage reporting in the annotated HTML file failed in Py3.9.
  314. Patch by Nick Pope. (Github issue #3865)
  315. * The embedding code now reports Python errors as exit status.
  316. * Long type declarations could lead to (harmless) random changes in the
  317. C file when used in auto-generated Python wrappers or pickled classes.
  318. Other changes
  319. -------------
  320. * Variables defined as ``cpdef`` now generate a warning since this
  321. is currently useless and thus does not do what users would expect.
  322. Patch by David Woods. (Github issue #3959)
  323. 0.29.21 (2020-07-09)
  324. ====================
  325. Bugs fixed
  326. ----------
  327. * Fix a regression in 0.29.20 where ``__div__`` failed to be found in extension types.
  328. (Github issue #3688)
  329. * Fix a regression in 0.29.20 where a call inside of a finally clause could fail to compile.
  330. Patch by David Woods. (Github issue #3712)
  331. * Zero-sized buffers could fail to validate as C/Fortran-contiguous.
  332. Patch by Clemens Hofreither. (Github issue #2093)
  333. * ``exec()`` did not allow recent Python syntax features in Py3.8+ due to
  334. https://bugs.python.org/issue35975.
  335. (Github issue #3695)
  336. * Binding staticmethods of Cython functions were not behaving like Python methods in Py3.
  337. Patch by Jeroen Demeyer and Michał Górny. (Github issue #3106)
  338. * Pythran calls to NumPy methods no longer generate useless method lookup code.
  339. * The ``PyUnicode_GET_LENGTH()`` macro was missing from the ``cpython.*`` declarations.
  340. Patch by Thomas Caswell. (Github issue #3692)
  341. * The deprecated ``PyUnicode_*()`` C-API functions are no longer used, except for Unicode
  342. strings that contain lone surrogates. Unicode strings that contain non-BMP characters
  343. or surrogate pairs now generate different C code on 16-bit Python 2.x Unicode deployments
  344. (such as MS-Windows). Generating the C code on Python 3.x is recommended in this case.
  345. Original patches by Inada Naoki and Victor Stinner. (Github issues #3677, #3721, #3697)
  346. * Some template parameters were missing from the C++ ``std::unordered_map`` declaration.
  347. Patch by will. (Github issue #3685)
  348. * Several internal code generation issues regarding temporary variables were resolved.
  349. (Github issue #3708)
  350. 0.29.20 (2020-06-10)
  351. ====================
  352. Bugs fixed
  353. ----------
  354. * Nested try-except statements with multiple ``return`` statements could crash
  355. due to incorrect deletion of the ``except as`` target variable.
  356. (Github issue #3666)
  357. * The ``@classmethod`` decorator no longer rejects unknown input from other decorators.
  358. Patch by David Woods. (Github issue #3660)
  359. * Fused types could leak into unrelated usages.
  360. Patch by David Woods. (Github issue #3642)
  361. * Now uses ``Py_SET_SIZE()`` and ``Py_SET_REFCNT()`` in Py3.9+ to avoid low-level
  362. write access to these object fields.
  363. Patch by Victor Stinner. (Github issue #3639)
  364. * The built-in ``abs()`` function could lead to undefined behaviour when used on
  365. the negative-most value of a signed C integer type.
  366. Patch by Serge Guelton. (Github issue #1911)
  367. * Usages of ``sizeof()`` and ``typeid()`` on uninitialised variables no longer
  368. produce a warning.
  369. Patch by Celelibi. (Github issue #3575)
  370. * The C++ ``typeid()`` function was allowed in C mode.
  371. Patch by Celelibi. (Github issue #3637)
  372. * The error position reported for errors found in f-strings was misleading.
  373. (Github issue #3674)
  374. * The new ``c_api_binop_methods`` directive was added for forward compatibility, but can
  375. only be set to True (the current default value). It can be disabled in Cython 3.0.
  376. 0.29.19 (2020-05-20)
  377. ====================
  378. Bugs fixed
  379. ----------
  380. * A typo in Windows specific code in 0.29.18 was fixed that broke "libc.math".
  381. (Github issue #3622)
  382. * A platform specific test failure in 0.29.18 was fixed.
  383. Patch by smutch. (Github issue #3620)
  384. 0.29.18 (2020-05-18)
  385. ====================
  386. Bugs fixed
  387. ----------
  388. * Exception position reporting could run into race conditions on threaded code.
  389. It now uses function-local variables again.
  390. * Error handling early in the module init code could lead to a crash.
  391. * Error handling in ``cython.array`` creation was improved to avoid calling
  392. C-API functions with an error held.
  393. * A memory corruption was fixed when garbage collection was triggered during calls
  394. to ``PyType_Ready()`` of extension type subclasses.
  395. (Github issue #3603)
  396. * Memory view slicing generated unused error handling code which could negatively
  397. impact the C compiler optimisations for parallel OpenMP code etc. Also, it is
  398. now helped by static branch hints.
  399. (Github issue #2987)
  400. * Cython's built-in OpenMP functions were not translated inside of call arguments.
  401. Original patch by Celelibi and David Woods. (Github issue #3594)
  402. * Complex buffer item types of structs of arrays could fail to validate.
  403. Patch by Leo and smutch. (Github issue #1407)
  404. * Decorators were not allowed on nested `async def` functions.
  405. (Github issue #1462)
  406. * C-tuples could use invalid C struct casting.
  407. Patch by MegaIng. (Github issue #3038)
  408. * Optimised ``%d`` string formatting into f-strings failed on float values.
  409. (Github issue #3092)
  410. * Optimised aligned string formatting (``%05s``, ``%-5s``) failed.
  411. (Github issue #3476)
  412. * When importing the old Cython ``build_ext`` integration with distutils, the
  413. additional command line arguments leaked into the regular command.
  414. Patch by Kamekameha. (Github issue #2209)
  415. * When using the ``CYTHON_NO_PYINIT_EXPORT`` option in C++, the module init function
  416. was not declared as ``extern "C"``.
  417. (Github issue #3414)
  418. * Three missing timedelta access macros were added in ``cpython.datetime``.
  419. * The signature of the NumPy C-API function ``PyArray_SearchSorted()`` was fixed.
  420. Patch by Brock Mendel. (Github issue #3606)
  421. 0.29.17 (2020-04-26)
  422. ====================
  423. Features added
  424. --------------
  425. * ``std::move()`` is now available from ``libcpp.utility``.
  426. Patch by Omer Ozarslan. (Github issue #2169)
  427. * The ``@cython.binding`` decorator is available in Python code.
  428. (Github issue #3505)
  429. Bugs fixed
  430. ----------
  431. * Creating an empty unicode slice with large bounds could crash.
  432. Patch by Sam Sneddon. (Github issue #3531)
  433. * Decoding an empty bytes/char* slice with large bounds could crash.
  434. Patch by Sam Sneddon. (Github issue #3534)
  435. * Re-importing a Cython extension no longer raises the error
  436. "``__reduce_cython__ not found``".
  437. (Github issue #3545)
  438. * Unused C-tuples could generate incorrect code in 0.29.16.
  439. Patch by Kirk Meyer. (Github issue #3543)
  440. * Creating a fused function attached it to the garbage collector before it
  441. was fully initialised, thus risking crashes in rare failure cases.
  442. Original patch by achernomorov. (Github issue #3215)
  443. * Temporary buffer indexing variables were not released and could show up in
  444. C compiler warnings, e.g. in generators.
  445. Patch by David Woods. (Github issues #3430, #3522)
  446. * The compilation cache in ``cython.inline("…")`` failed to take the language
  447. level into account.
  448. Patch by will-ca. (Github issue #3419)
  449. * The deprecated ``PyUnicode_GET_SIZE()`` function is no longer used in Py3.
  450. 0.29.16 (2020-03-24)
  451. ====================
  452. Bugs fixed
  453. ----------
  454. * Temporary internal variables in nested prange loops could leak into other
  455. threads. Patch by Frank Schlimbach. (Github issue #3348)
  456. * Default arguments on fused functions could crash.
  457. Patch by David Woods. (Github issue #3370)
  458. * C-tuples declared in ``.pxd`` files could generate incomplete C code.
  459. Patch by Kirk Meyer. (Github issue #1427)
  460. * Fused functions were not always detected and optimised as Cython
  461. implemented functions.
  462. Patch by David Woods. (Github issue #3384)
  463. * Valid Python object concatenation of (iterable) strings to non-strings
  464. could fail with an exception.
  465. Patch by David Woods. (Github issue #3433)
  466. * Using C functions as temporary values lead to invalid C code.
  467. Original patch by David Woods. (Github issue #3418)
  468. * Fix an unhandled C++ exception in comparisons.
  469. Patch by David Woods. (Github issue #3361)
  470. * Fix deprecated import of "imp" module.
  471. Patch by Matti Picus. (Github issue #3350)
  472. * Fix compatibility with Pythran 0.9.6 and later.
  473. Patch by Serge Guelton. (Github issue #3308)
  474. * The ``_Py_PyAtExit()`` function in ``cpython.pylifecycle`` was misdeclared.
  475. Patch by Zackery Spytz. (Github issue #3382)
  476. * Several missing declarations in ``cpython.*`` were added.
  477. Patches by Zackery Spytz. (Github issue #3452, #3421, #3411, #3402)
  478. * A declaration for ``libc.math.fpclassify()`` was added.
  479. Patch by Zackery Spytz. (Github issue #2514)
  480. * Avoid "undeclared" warning about automatically generated pickle methods.
  481. Patch by David Woods. (Github issue #3353)
  482. * Avoid C compiler warning about unreachable code in ``prange()``.
  483. * Some C compiler warnings in PyPy were resolved.
  484. Patch by Matti Picus. (Github issue #3437)
  485. 0.29.15 (2020-02-06)
  486. ====================
  487. Bugs fixed
  488. ----------
  489. * Crash when returning a temporary Python object from an async-def function.
  490. (Github issue #3337)
  491. * Crash when using ``**kwargs`` in generators.
  492. Patch by David Woods. (Github issue #3265)
  493. * Double reference free in ``__class__`` cell handling for ``super()`` calls.
  494. (Github issue #3246)
  495. * Compile error when using ``*args`` as Python class bases.
  496. (Github issue #3338)
  497. * Import failure in IPython 7.11.
  498. (Github issue #3297)
  499. * Fixed C name collision in the auto-pickle code.
  500. Patch by ThePrez. (Github issue #3238)
  501. * Deprecated import failed in Python 3.9.
  502. (Github issue #3266)
  503. 0.29.14 (2019-11-01)
  504. ====================
  505. Bugs fixed
  506. ----------
  507. * The generated code failed to initialise the ``tp_print`` slot in CPython 3.8.
  508. Patches by Pablo Galindo and Orivej Desh. (Github issues #3171, #3201)
  509. * ``?`` for ``bool`` was missing from the supported NumPy dtypes.
  510. Patch by Max Klein. (Github issue #2675)
  511. * ``await`` was not allowed inside of f-strings.
  512. Patch by Dmitro Getz. (Github issue #2877)
  513. * Coverage analysis failed for projects where the code resides in separate
  514. source sub-directories.
  515. Patch by Antonio Valentino. (Github issue #1985)
  516. * An incorrect compiler warning was fixed in automatic C++ string conversions.
  517. Patch by Gerion Entrup. (Github issue #3108)
  518. * Error reports in the Jupyter notebook showed unhelpful stack traces.
  519. Patch by Matthew Edwards (Github issue #3196).
  520. * ``Python.h`` is now also included explicitly from ``public`` header files.
  521. (Github issue #3133).
  522. * Distutils builds with ``--parallel`` did not work when using Cython's
  523. deprecated ``build_ext`` command.
  524. Patch by Alphadelta14 (Github issue #3187).
  525. Other changes
  526. -------------
  527. * The ``PyMemoryView_*()`` C-API is available in ``cpython.memoryview``.
  528. Patch by Nathan Manville. (Github issue #2541)
  529. 0.29.13 (2019-07-26)
  530. ====================
  531. Bugs fixed
  532. ----------
  533. * A reference leak for ``None`` was fixed when converting a memoryview
  534. to a Python object. (Github issue #3023)
  535. * The declaration of ``PyGILState_STATE`` in ``cpython.pystate`` was unusable.
  536. Patch by Kirill Smelkov. (Github issue #2997)
  537. Other changes
  538. -------------
  539. * The declarations in ``posix.mman`` were extended.
  540. Patches by Kirill Smelkov. (Github issues #2893, #2894, #3012)
  541. 0.29.12 (2019-07-07)
  542. ====================
  543. Bugs fixed
  544. ----------
  545. * Fix compile error in CPython 3.8b2 regarding the ``PyCode_New()`` signature.
  546. (Github issue #3031)
  547. * Fix a C compiler warning about a missing ``int`` downcast.
  548. (Github issue #3028)
  549. * Fix reported error positions of undefined builtins and constants.
  550. Patch by Orivej Desh. (Github issue #3030)
  551. * A 32 bit issue in the Pythran support was resolved.
  552. Patch by Serge Guelton. (Github issue #3032)
  553. 0.29.11 (2019-06-30)
  554. ====================
  555. Bugs fixed
  556. ----------
  557. * Fix compile error in CPython 3.8b2 regarding the ``PyCode_New()`` signature.
  558. Patch by Nick Coghlan. (Github issue #3009)
  559. * Invalid C code generated for lambda functions in cdef methods.
  560. Patch by Josh Tobin. (Github issue #2967)
  561. * Support slice handling in newer Pythran versions.
  562. Patch by Serge Guelton. (Github issue #2989)
  563. * A reference leak in power-of-2 calculation was fixed.
  564. Patch by Sebastian Berg. (Github issue #3022)
  565. * The search order for include files was changed. Previously it was
  566. ``include_directories``, ``Cython/Includes``, ``sys.path``. Now it is
  567. ``include_directories``, ``sys.path``, ``Cython/Includes``. This was done to
  568. allow third-party ``*.pxd`` files to override the ones in Cython.
  569. Original patch by Matti Picus. (Github issue #2905)
  570. * Setting ``language_level=2`` in a file did not work if ``language_level=3``
  571. was enabled globally before.
  572. Patch by Jeroen Demeyer. (Github issue #2791)
  573. 0.29.10 (2019-06-02)
  574. ====================
  575. Bugs fixed
  576. ----------
  577. * Fix compile errors in CPython 3.8b1 due to the new "tp_vectorcall" slots.
  578. (Github issue #2976)
  579. 0.29.9 (2019-05-29)
  580. ===================
  581. Bugs fixed
  582. ----------
  583. * Fix a crash regression in 0.29.8 when creating code objects fails.
  584. * Remove an incorrect cast when using true-division in C++ operations.
  585. (Github issue #1950)
  586. 0.29.8 (2019-05-28)
  587. ===================
  588. Bugs fixed
  589. ----------
  590. * C compile errors with CPython 3.8 were resolved.
  591. Patch by Marcel Plch. (Github issue #2938)
  592. * Python tuple constants that compare equal but have different item
  593. types could incorrectly be merged into a single constant.
  594. (Github issue #2919)
  595. * Non-ASCII characters in unprefixed strings could crash the compiler when
  596. used with language level ``3str``.
  597. * Starred expressions in %-formatting tuples could fail to compile for
  598. unicode strings. (Github issue #2939)
  599. * Passing Python class references through ``cython.inline()`` was broken.
  600. (Github issue #2936)
  601. 0.29.7 (2019-04-14)
  602. ===================
  603. Bugs fixed
  604. ----------
  605. * Crash when the shared Cython config module gets unloaded and another Cython
  606. module reports an exceptions. Cython now makes sure it keeps an owned reference
  607. to the module.
  608. (Github issue #2885)
  609. * Resolved a C89 compilation problem when enabling the fast-gil sharing feature.
  610. * Coverage reporting did not include the signature line of ``cdef`` functions.
  611. (Github issue #1461)
  612. * Casting a GIL-requiring function into a nogil function now issues a warning.
  613. (Github issue #2879)
  614. * Generators and coroutines were missing their return type annotation.
  615. (Github issue #2884)
  616. 0.29.6 (2019-02-27)
  617. ===================
  618. Bugs fixed
  619. ----------
  620. * Fix a crash when accessing the ``__kwdefaults__`` special attribute of
  621. fused functions. (Github issue #1470)
  622. * Fix the parsing of buffer format strings that contain numeric sizes, which
  623. could lead to incorrect input rejections. (Github issue #2845)
  624. * Avoid a C #pragma in old gcc versions that was only added in GCC 4.6.
  625. Patch by Michael Anselmi. (Github issue #2838)
  626. * Auto-encoding of Unicode strings to UTF-8 C/C++ strings failed in Python 3,
  627. even though the default encoding there is UTF-8.
  628. (Github issue #2819)
  629. 0.29.5 (2019-02-09)
  630. ===================
  631. Bugs fixed
  632. ----------
  633. * Crash when defining a Python subclass of an extension type and repeatedly calling
  634. a cpdef method on it. (Github issue #2823)
  635. * Compiler crash when ``prange()`` loops appear inside of with-statements.
  636. (Github issue #2780)
  637. * Some C compiler warnings were resolved.
  638. Patches by Christoph Gohlke. (Github issues #2815, #2816, #2817, #2822)
  639. * Python conversion of C++ enums failed in 0.29.
  640. Patch by Orivej Desh. (Github issue #2767)
  641. 0.29.4 (2019-02-01)
  642. ===================
  643. Bugs fixed
  644. ----------
  645. * Division of numeric constants by a runtime value of 0 could fail to raise a
  646. ``ZeroDivisionError``. (Github issue #2820)
  647. 0.29.3 (2019-01-19)
  648. ===================
  649. Bugs fixed
  650. ----------
  651. * Some C code for memoryviews was generated in a non-deterministic order.
  652. Patch by Martijn van Steenbergen. (Github issue #2779)
  653. * C89 compatibility was accidentally lost since 0.28.
  654. Patches by gastineau and true-pasky. (Github issues #2778, #2801)
  655. * A C compiler cast warning was resolved.
  656. Patch by Michael Buesch. (Github issue #2774)
  657. * An compilation failure with complex numbers under MSVC++ was resolved.
  658. (Github issue #2797)
  659. * Coverage reporting could fail when modules were moved around after the build.
  660. Patch by Wenjun Si. (Github issue #2776)
  661. 0.29.2 (2018-12-14)
  662. ===================
  663. Bugs fixed
  664. ----------
  665. * The code generated for deduplicated constants leaked some references.
  666. (Github issue #2750)
  667. * The declaration of ``sigismember()`` in ``libc.signal`` was corrected.
  668. (Github issue #2756)
  669. * Crashes in compiler and test runner were fixed.
  670. (Github issue #2736, #2755)
  671. * A C compiler warning about an invalid safety check was resolved.
  672. (Github issue #2731)
  673. 0.29.1 (2018-11-24)
  674. ===================
  675. Bugs fixed
  676. ----------
  677. * Extensions compiled with MinGW-64 under Windows could misinterpret integer
  678. objects larger than 15 bit and return incorrect results.
  679. (Github issue #2670)
  680. * Cython no longer requires the source to be writable when copying its data
  681. into a memory view slice.
  682. Patch by Andrey Paramonov. (Github issue #2644)
  683. * Line tracing of ``try``-statements generated invalid C code.
  684. (Github issue #2274)
  685. * When using the ``warn.undeclared`` directive, Cython's own code generated
  686. warnings that are now fixed.
  687. Patch by Nicolas Pauss. (Github issue #2685)
  688. * Cython's memoryviews no longer require strides for setting the shape field
  689. but only the ``PyBUF_ND`` flag to be set.
  690. Patch by John Kirkham. (Github issue #2716)
  691. * Some C compiler warnings about unused memoryview code were fixed.
  692. Patch by Ho Cheuk Ting. (Github issue #2588)
  693. * A C compiler warning about implicit signed/unsigned conversion was fixed.
  694. (Github issue #2729)
  695. * Assignments to C++ references returned by ``operator[]`` could fail to compile.
  696. (Github issue #2671)
  697. * The power operator and the support for NumPy math functions were fixed
  698. in Pythran expressions.
  699. Patch by Serge Guelton. (Github issues #2702, #2709)
  700. * Signatures with memory view arguments now show the expected type
  701. when embedded in docstrings.
  702. Patch by Matthew Chan and Benjamin Weigel. (Github issue #2634)
  703. * Some ``from ... cimport ...`` constructs were not correctly considered
  704. when searching modified dependencies in ``cythonize()`` to decide
  705. whether to recompile a module.
  706. Patch by Kryštof Pilnáček. (Github issue #2638)
  707. * A struct field type in the ``cpython.array`` declarations was corrected.
  708. Patch by John Kirkham. (Github issue #2712)
  709. 0.29 (2018-10-14)
  710. =================
  711. Features added
  712. --------------
  713. * PEP-489 multi-phase module initialisation has been enabled again. Module
  714. reloads in other subinterpreters raise an exception to prevent corruption
  715. of the static module state.
  716. * A set of ``mypy`` compatible PEP-484 declarations were added for Cython's C data
  717. types to integrate with static analysers in typed Python code. They are available
  718. in the ``Cython/Shadow.pyi`` module and describe the types in the special ``cython``
  719. module that can be used for typing in Python code.
  720. Original patch by Julian Gethmann. (Github issue #1965)
  721. * Memoryviews are supported in PEP-484/526 style type declarations.
  722. (Github issue #2529)
  723. * ``@cython.nogil`` is supported as a C-function decorator in Python code.
  724. (Github issue #2557)
  725. * Raising exceptions from nogil code will automatically acquire the GIL, instead
  726. of requiring an explicit ``with gil`` block.
  727. * C++ functions can now be declared as potentially raising both C++ and Python
  728. exceptions, so that Cython can handle both correctly.
  729. (Github issue #2615)
  730. * ``cython.inline()`` supports a direct ``language_level`` keyword argument that
  731. was previously only available via a directive.
  732. * A new language level name ``3str`` was added that mostly corresponds to language
  733. level 3, but keeps unprefixed string literals as type 'str' in both Py2 and Py3,
  734. and the builtin 'str' type unchanged. This will become the default in the next
  735. Cython release and is meant to help user code a) transition more easily to this
  736. new default and b) migrate to Python 3 source code semantics without making support
  737. for Python 2.x difficult.
  738. * In CPython 3.6 and later, looking up globals in the module dict is almost
  739. as fast as looking up C globals.
  740. (Github issue #2313)
  741. * For a Python subclass of an extension type, repeated method calls to non-overridden
  742. cpdef methods can avoid the attribute lookup in Py3.6+, which makes them 4x faster.
  743. (Github issue #2313)
  744. * (In-)equality comparisons of objects to integer literals are faster.
  745. (Github issue #2188)
  746. * Some internal and 1-argument method calls are faster.
  747. * Modules that cimport many external extension types from other Cython modules
  748. execute less import requests during module initialisation.
  749. * Constant tuples and slices are deduplicated and only created once per module.
  750. (Github issue #2292)
  751. * The coverage plugin considers more C file extensions such as ``.cc`` and ``.cxx``.
  752. (Github issue #2266)
  753. * The ``cythonize`` command accepts compile time variable values (as set by ``DEF``)
  754. through the new ``-E`` option.
  755. Patch by Jerome Kieffer. (Github issue #2315)
  756. * ``pyximport`` can import from namespace packages.
  757. Patch by Prakhar Goel. (Github issue #2294)
  758. * Some missing numpy and CPython C-API declarations were added.
  759. Patch by John Kirkham. (Github issues #2523, #2520, #2537)
  760. * Declarations for the ``pylifecycle`` C-API functions were added in a new .pxd file
  761. ``cpython.pylifecycle``.
  762. * The Pythran support was updated to work with the latest Pythran 0.8.7.
  763. Original patch by Adrien Guinet. (Github issue #2600)
  764. * ``%a`` is included in the string formatting types that are optimised into f-strings.
  765. In this case, it is also automatically mapped to ``%r`` in Python 2.x.
  766. * New C macro ``CYTHON_HEX_VERSION`` to access Cython's version in the same style as
  767. ``PY_VERSION_HEX``.
  768. * Constants in ``libc.math`` are now declared as ``const`` to simplify their handling.
  769. * An additional ``check_size`` clause was added to the ``ctypedef class`` name
  770. specification to allow suppressing warnings when importing modules with
  771. backwards-compatible ``PyTypeObject`` size changes.
  772. Patch by Matti Picus. (Github issue #2627)
  773. Bugs fixed
  774. ----------
  775. * The exception handling in generators and coroutines under CPython 3.7 was adapted
  776. to the newly introduced exception stack. Users of Cython 0.28 who want to support
  777. Python 3.7 are encouraged to upgrade to 0.29 to avoid potentially incorrect error
  778. reporting and tracebacks. (Github issue #1958)
  779. * Crash when importing a module under Stackless Python that was built for CPython.
  780. Patch by Anselm Kruis. (Github issue #2534)
  781. * 2-value slicing of typed sequences failed if the start or stop index was None.
  782. Patch by Christian Gibson. (Github issue #2508)
  783. * Multiplied string literals lost their factor when they are part of another
  784. constant expression (e.g. 'x' * 10 + 'y' => 'xy').
  785. * String formatting with the '%' operator didn't call the special ``__rmod__()``
  786. method if the right side is a string subclass that implements it.
  787. (Python issue 28598)
  788. * The directive ``language_level=3`` did not apply to the first token in the
  789. source file. (Github issue #2230)
  790. * Overriding cpdef methods did not work in Python subclasses with slots.
  791. Note that this can have a performance impact on calls from Cython code.
  792. (Github issue #1771)
  793. * Fix declarations of builtin or C types using strings in pure python mode.
  794. (Github issue #2046)
  795. * Generator expressions and lambdas failed to compile in ``@cfunc`` functions.
  796. (Github issue #459)
  797. * Global names with ``const`` types were not excluded from star-import assignments
  798. which could lead to invalid C code.
  799. (Github issue #2621)
  800. * Several internal function signatures were fixed that lead to warnings in gcc-8.
  801. (Github issue #2363)
  802. * The numpy helper functions ``set_array_base()`` and ``get_array_base()``
  803. were adapted to the current numpy C-API recommendations.
  804. Patch by Matti Picus. (Github issue #2528)
  805. * Some NumPy related code was updated to avoid deprecated API usage.
  806. Original patch by jbrockmendel. (Github issue #2559)
  807. * Several C++ STL declarations were extended and corrected.
  808. Patch by Valentin Valls. (Github issue #2207)
  809. * C lines of the module init function were unconditionally not reported in
  810. exception stack traces.
  811. Patch by Jeroen Demeyer. (Github issue #2492)
  812. * When PEP-489 support is enabled, reloading the module overwrote any static
  813. module state. It now raises an exception instead, given that reloading is
  814. not actually supported.
  815. * Object-returning, C++ exception throwing functions were not checking that
  816. the return value was non-null.
  817. Original patch by Matt Wozniski (Github Issue #2603)
  818. * The source file encoding detection could get confused if the
  819. ``c_string_encoding`` directive appeared within the first two lines.
  820. (Github issue #2632)
  821. * Cython generated modules no longer emit a warning during import when the
  822. size of the NumPy array type is larger than what was found at compile time.
  823. Instead, this is assumed to be a backwards compatible change on NumPy side.
  824. Other changes
  825. -------------
  826. * Cython now emits a warning when no ``language_level`` (2, 3 or '3str') is set
  827. explicitly, neither as a ``cythonize()`` option nor as a compiler directive.
  828. This is meant to prepare the transition of the default language level from
  829. currently Py2 to Py3, since that is what most new users will expect these days.
  830. The future default will, however, not enforce unicode literals, because this
  831. has proven a major obstacle in the support for both Python 2.x and 3.x. The
  832. next major release is intended to make this change, so that it will parse all
  833. code that does not request a specific language level as Python 3 code, but with
  834. ``str`` literals. The language level 2 will continue to be supported for an
  835. indefinite time.
  836. * The documentation was restructured, cleaned up and examples are now tested.
  837. The NumPy tutorial was also rewritten to simplify the running example.
  838. Contributed by Gabriel de Marmiesse. (Github issue #2245)
  839. * Cython compiles less of its own modules at build time to reduce the installed
  840. package size to about half of its previous size. This makes the compiler
  841. slightly slower, by about 5-7%.
  842. 0.28.6 (2018-11-01)
  843. ===================
  844. Bugs fixed
  845. ----------
  846. * Extensions compiled with MinGW-64 under Windows could misinterpret integer
  847. objects larger than 15 bit and return incorrect results.
  848. (Github issue #2670)
  849. * Multiplied string literals lost their factor when they are part of another
  850. constant expression (e.g. 'x' * 10 + 'y' => 'xy').
  851. 0.28.5 (2018-08-03)
  852. ===================
  853. Bugs fixed
  854. ----------
  855. * The discouraged usage of GCC's attribute ``optimize("Os")`` was replaced by the
  856. similar attribute ``cold`` to reduce the code impact of the module init functions.
  857. (Github issue #2494)
  858. * A reference leak in Py2.x was fixed when comparing str to unicode for equality.
  859. 0.28.4 (2018-07-08)
  860. ===================
  861. Bugs fixed
  862. ----------
  863. * Reallowing ``tp_clear()`` in a subtype of an ``@no_gc_clear`` extension type
  864. generated an invalid C function call to the (non-existent) base type implementation.
  865. (Github issue #2309)
  866. * Exception catching based on a non-literal (runtime) tuple could fail to match the
  867. exception. (Github issue #2425)
  868. * Compile fix for CPython 3.7.0a2. (Github issue #2477)
  869. 0.28.3 (2018-05-27)
  870. ===================
  871. Bugs fixed
  872. ----------
  873. * Set iteration was broken in non-CPython since 0.28.
  874. * ``UnicodeEncodeError`` in Py2 when ``%s`` formatting is optimised for
  875. unicode strings. (Github issue #2276)
  876. * Work around a crash bug in g++ 4.4.x by disabling the size reduction setting
  877. of the module init function in this version. (Github issue #2235)
  878. * Crash when exceptions occur early during module initialisation.
  879. (Github issue #2199)
  880. 0.28.2 (2018-04-13)
  881. ===================
  882. Features added
  883. --------------
  884. * ``abs()`` is faster for Python long objects.
  885. * The C++11 methods ``front()`` and ``end()`` were added to the declaration of
  886. ``libcpp.string``. Patch by Alex Huszagh. (Github issue #2123)
  887. * The C++11 methods ``reserve()`` and ``bucket_count()`` are declared for
  888. ``libcpp.unordered_map``. Patch by Valentin Valls. (Github issue #2168)
  889. Bugs fixed
  890. ----------
  891. * The copy of a read-only memoryview was considered read-only as well, whereas
  892. a common reason to copy a read-only view is to make it writable. The result
  893. of the copying is now a writable buffer by default.
  894. (Github issue #2134)
  895. * The ``switch`` statement generation failed to apply recursively to the body of
  896. converted if-statements.
  897. * ``NULL`` was sometimes rejected as exception return value when the returned
  898. type is a fused pointer type.
  899. Patch by Callie LeFave. (Github issue #2177)
  900. * Fixed compatibility with PyPy 5.11.
  901. Patch by Matti Picus. (Github issue #2165)
  902. Other changes
  903. -------------
  904. * The NumPy tutorial was rewritten to use memoryviews instead of the older
  905. buffer declaration syntax.
  906. Contributed by Gabriel de Marmiesse. (Github issue #2162)
  907. 0.28.1 (2018-03-18)
  908. ===================
  909. Bugs fixed
  910. ----------
  911. * ``PyFrozenSet_New()`` was accidentally used in PyPy where it is missing
  912. from the C-API.
  913. * Assignment between some C++ templated types were incorrectly rejected
  914. when the templates mix ``const`` with ``ctypedef``.
  915. (Github issue #2148)
  916. * Undeclared C++ no-args constructors in subclasses could make the compilation
  917. fail if the base class constructor was declared without ``nogil``.
  918. (Github issue #2157)
  919. * Bytes %-formatting inferred ``basestring`` (bytes or unicode) as result type
  920. in some cases where ``bytes`` would have been safe to infer.
  921. (Github issue #2153)
  922. * ``None`` was accidentally disallowed as typed return value of ``dict.pop()``.
  923. (Github issue #2152)
  924. 0.28 (2018-03-13)
  925. =================
  926. Features added
  927. --------------
  928. * Cdef classes can now multiply inherit from ordinary Python classes.
  929. (The primary base must still be a c class, possibly ``object``, and
  930. the other bases must *not* be cdef classes.)
  931. * Type inference is now supported for Pythran compiled NumPy expressions.
  932. Patch by Nils Braun. (Github issue #1954)
  933. * The ``const`` modifier can be applied to memoryview declarations to allow
  934. read-only buffers as input. (Github issues #1605, #1869)
  935. * C code in the docstring of a ``cdef extern`` block is copied verbatimly
  936. into the generated file.
  937. Patch by Jeroen Demeyer. (Github issue #1915)
  938. * When compiling with gcc, the module init function is now tuned for small
  939. code size instead of whatever compile flags were provided externally.
  940. Cython now also disables some code intensive optimisations in that function
  941. to further reduce the code size. (Github issue #2102)
  942. * Decorating an async coroutine with ``@cython.iterable_coroutine`` changes its
  943. type at compile time to make it iterable. While this is not strictly in line
  944. with PEP-492, it improves the interoperability with old-style coroutines that
  945. use ``yield from`` instead of ``await``.
  946. * The IPython magic has preliminary support for JupyterLab.
  947. (Github issue #1775)
  948. * The new TSS C-API in CPython 3.7 is supported and has been backported.
  949. Patch by Naotoshi Seo. (Github issue #1932)
  950. * Cython knows the new ``Py_tss_t`` type defined in PEP-539 and automatically
  951. initialises variables declared with that type to ``Py_tss_NEEDS_INIT``,
  952. a value which cannot be used outside of static assignments.
  953. * The set methods ``.remove()`` and ``.discard()`` are optimised.
  954. Patch by Antoine Pitrou. (Github issue #2042)
  955. * ``dict.pop()`` is optimised.
  956. Original patch by Antoine Pitrou. (Github issue #2047)
  957. * Iteration over sets and frozensets is optimised.
  958. (Github issue #2048)
  959. * Safe integer loops (< range(2^30)) are automatically optimised into C loops.
  960. * ``alist.extend([a,b,c])`` is optimised into sequential ``list.append()`` calls
  961. for short literal sequences.
  962. * Calls to builtin methods that are not specifically optimised into C-API calls
  963. now use a cache that avoids repeated lookups of the underlying C function.
  964. (Github issue #2054)
  965. * Single argument function calls can avoid the argument tuple creation in some cases.
  966. * Some redundant extension type checks are avoided.
  967. * Formatting C enum values in f-strings is faster, as well as some other special cases.
  968. * String formatting with the '%' operator is optimised into f-strings in simple cases.
  969. * Subscripting (item access) is faster in some cases.
  970. * Some ``bytearray`` operations have been optimised similar to ``bytes``.
  971. * Some PEP-484/526 container type declarations are now considered for
  972. loop optimisations.
  973. * Indexing into memoryview slices with ``view[i][j]`` is now optimised into
  974. ``view[i, j]``.
  975. * Python compatible ``cython.*`` types can now be mixed with type declarations
  976. in Cython syntax.
  977. * Name lookups in the module and in classes are faster.
  978. * Python attribute lookups on extension types without instance dict are faster.
  979. * Some missing signals were added to ``libc/signal.pxd``.
  980. Patch by Jeroen Demeyer. (Github issue #1914)
  981. * The warning about repeated extern declarations is now visible by default.
  982. (Github issue #1874)
  983. * The exception handling of the function types used by CPython's type slot
  984. functions was corrected to match the de-facto standard behaviour, so that
  985. code that uses them directly benefits from automatic and correct exception
  986. propagation. Patch by Jeroen Demeyer. (Github issue #1980)
  987. * Defining the macro ``CYTHON_NO_PYINIT_EXPORT`` will prevent the module init
  988. function from being exported as symbol, e.g. when linking modules statically
  989. in an embedding setup. Patch by AraHaan. (Github issue #1944)
  990. Bugs fixed
  991. ----------
  992. * If a module name is explicitly provided for an ``Extension()`` that is compiled
  993. via ``cythonize()``, it was previously ignored and replaced by the source file
  994. name. It can now be used to override the target module name, e.g. for compiling
  995. prefixed accelerator modules from Python files. (Github issue #2038)
  996. * The arguments of the ``num_threads`` parameter of parallel sections
  997. were not sufficiently validated and could lead to invalid C code.
  998. (Github issue #1957)
  999. * Catching exceptions with a non-trivial exception pattern could call into
  1000. CPython with a live exception set. This triggered incorrect behaviour
  1001. and crashes, especially in CPython 3.7.
  1002. * The signature of the special ``__richcmp__()`` method was corrected to recognise
  1003. the type of the first argument as ``self``. It was previously treated as plain
  1004. object, but CPython actually guarantees that it always has the correct type.
  1005. Note: this can change the semantics of user code that previously relied on
  1006. ``self`` being untyped.
  1007. * Some Python 3 exceptions were not recognised as builtins when running Cython
  1008. under Python 2.
  1009. * Some async helper functions were not defined in the generated C code when
  1010. compiling simple async code. (Github issue #2075)
  1011. * Line tracing did not include generators and coroutines.
  1012. (Github issue #1949)
  1013. * C++ declarations for ``unordered_map`` were corrected.
  1014. Patch by Michael Schatzow. (Github issue #1484)
  1015. * Iterator declarations in C++ ``deque`` and ``vector`` were corrected.
  1016. Patch by Alex Huszagh. (Github issue #1870)
  1017. * The const modifiers in the C++ ``string`` declarations were corrected, together
  1018. with the coercion behaviour of string literals into C++ strings.
  1019. (Github issue #2132)
  1020. * Some declaration types in ``libc.limits`` were corrected.
  1021. Patch by Jeroen Demeyer. (Github issue #2016)
  1022. * ``@cython.final`` was not accepted on Python classes with an ``@cython.cclass``
  1023. decorator. (Github issue #2040)
  1024. * Cython no longer creates useless and incorrect ``PyInstanceMethod`` wrappers for
  1025. methods in Python 3. Patch by Jeroen Demeyer. (Github issue #2105)
  1026. * The builtin ``bytearray`` type could not be used as base type of cdef classes.
  1027. (Github issue #2106)
  1028. Other changes
  1029. -------------
  1030. 0.27.3 (2017-11-03)
  1031. ===================
  1032. Bugs fixed
  1033. ----------
  1034. * String forward references to extension types like ``@cython.locals(x="ExtType")``
  1035. failed to find the named type. (Github issue #1962)
  1036. * NumPy slicing generated incorrect results when compiled with Pythran.
  1037. Original patch by Serge Guelton (Github issue #1946).
  1038. * Fix "undefined reference" linker error for generators on Windows in Py3.3-3.5.
  1039. (Github issue #1968)
  1040. * Adapt to recent C-API change of ``PyThreadState`` in CPython 3.7.
  1041. * Fix signature of ``PyWeakref_GetObject()`` API declaration.
  1042. Patch by Jeroen Demeyer (Github issue #1975).
  1043. 0.27.2 (2017-10-22)
  1044. ===================
  1045. Bugs fixed
  1046. ----------
  1047. * Comprehensions could incorrectly be optimised away when they appeared in boolean
  1048. test contexts. (Github issue #1920)
  1049. * The special methods ``__eq__``, ``__lt__`` etc. in extension types did not type
  1050. their first argument as the type of the class but ``object``. (Github issue #1935)
  1051. * Crash on first lookup of "cline_in_traceback" option during exception handling.
  1052. (Github issue #1907)
  1053. * Some nested module level comprehensions failed to compile.
  1054. (Github issue #1906)
  1055. * Compiler crash on some complex type declarations in pure mode.
  1056. (Github issue #1908)
  1057. * ``std::unordered_map.erase()`` was declared with an incorrect ``void`` return
  1058. type in ``libcpp.unordered_map``. (Github issue #1484)
  1059. * Invalid use of C++ ``fallthrough`` attribute before C++11 and similar issue in clang.
  1060. (Github issue #1930)
  1061. * Compiler crash on misnamed properties. (Github issue #1905)
  1062. 0.27.1 (2017-10-01)
  1063. ===================
  1064. Features added
  1065. --------------
  1066. * The Jupyter magic has a new debug option ``--verbose`` that shows details about
  1067. the distutils invocation. Patch by Boris Filippov (Github issue #1881).
  1068. Bugs fixed
  1069. ----------
  1070. * Py3 list comprehensions in class bodies resulted in invalid C code.
  1071. (Github issue #1889)
  1072. * Modules built for later CPython 3.5.x versions failed to import in 3.5.0/3.5.1.
  1073. (Github issue #1880)
  1074. * Deallocating fused types functions and methods kept their GC tracking enabled,
  1075. which could potentially lead to recursive deallocation attempts.
  1076. * Crash when compiling in C++ mode with old setuptools versions.
  1077. (Github issue #1879)
  1078. * C++ object arguments for the constructor of Cython implemented C++ are now
  1079. passed by reference and not by value to allow for non-copyable arguments, such
  1080. as ``unique_ptr``.
  1081. * API-exported C++ classes with Python object members failed to compile.
  1082. (Github issue #1866)
  1083. * Some issues with the new relaxed exception value handling were resolved.
  1084. * Python classes as annotation types could prevent compilation.
  1085. (Github issue #1887)
  1086. * Cython annotation types in Python files could lead to import failures
  1087. with a "cython undefined" error. Recognised types are now turned into strings.
  1088. * Coverage analysis could fail to report on extension modules on some platforms.
  1089. * Annotations could be parsed (and rejected) as types even with
  1090. ``annotation_typing=False``.
  1091. Other changes
  1092. -------------
  1093. * PEP 489 support has been disabled by default to counter incompatibilities with
  1094. import setups that try to reload or reinitialise modules.
  1095. 0.27 (2017-09-23)
  1096. =================
  1097. Features added
  1098. --------------
  1099. * Extension module initialisation follows
  1100. `PEP 489 <https://www.python.org/dev/peps/pep-0489/>`_ in CPython 3.5+, which
  1101. resolves several differences with regard to normal Python modules. This makes
  1102. the global names ``__file__`` and ``__path__`` correctly available to module
  1103. level code and improves the support for module-level relative imports.
  1104. (Github issues #1715, #1753, #1035)
  1105. * Asynchronous generators (`PEP 525 <https://www.python.org/dev/peps/pep-0525/>`_)
  1106. and asynchronous comprehensions (`PEP 530 <https://www.python.org/dev/peps/pep-0530/>`_)
  1107. have been implemented. Note that async generators require finalisation support
  1108. in order to allow for asynchronous operations during cleanup, which is only
  1109. available in CPython 3.6+. All other functionality has been backported as usual.
  1110. * Variable annotations are now parsed according to
  1111. `PEP 526 <https://www.python.org/dev/peps/pep-0526/>`_. Cython types (e.g.
  1112. ``cython.int``) are evaluated as C type declarations and everything else as Python
  1113. types. This can be disabled with the directive ``annotation_typing=False``.
  1114. Note that most complex PEP-484 style annotations are currently ignored. This will
  1115. change in future releases. (Github issue #1850)
  1116. * Extension types (also in pure Python mode) can implement the normal special methods
  1117. ``__eq__``, ``__lt__`` etc. for comparisons instead of the low-level ``__richcmp__``
  1118. method. (Github issue #690)
  1119. * New decorator ``@cython.exceptval(x=None, check=False)`` that makes the signature
  1120. declarations ``except x``, ``except? x`` and ``except *`` available to pure Python
  1121. code. Original patch by Antonio Cuni. (Github issue #1653)
  1122. * Signature annotations are now included in the signature docstring generated by
  1123. the ``embedsignature`` directive. Patch by Lisandro Dalcin (Github issue #1781).
  1124. * The gdb support for Python code (``libpython.py``) was updated to the latest
  1125. version in CPython 3.7 (git rev 5fe59f8).
  1126. * The compiler tries to find a usable exception return value for cdef functions
  1127. with ``except *`` if the returned type allows it. Note that this feature is subject
  1128. to safety limitations, so it is still better to provide an explicit declaration.
  1129. * C functions can be assigned to function pointers with a compatible exception
  1130. declaration, not only with exact matches. A side-effect is that certain compatible
  1131. signature overrides are now allowed and some more mismatches of exception signatures
  1132. are now detected and rejected as errors that were not detected before.
  1133. * The IPython/Jupyter magic integration has a new option ``%%cython --pgo`` for profile
  1134. guided optimisation. It compiles the cell with PGO settings for the C compiler,
  1135. executes it to generate a runtime profile, and then compiles it again using that
  1136. profile for C compiler optimisation. Currently only tested with gcc.
  1137. * ``len(memoryview)`` can be used in nogil sections to get the size of the
  1138. first dimension of a memory view (``shape[0]``). (Github issue #1733)
  1139. * C++ classes can now contain (properly refcounted) Python objects.
  1140. * NumPy dtype subarrays are now accessible through the C-API.
  1141. Patch by Gerald Dalley (Github issue #245).
  1142. * Resolves several issues with PyPy and uses faster async slots in PyPy3.
  1143. Patch by Ronan Lamy (Github issues #1871, #1878).
  1144. Bugs fixed
  1145. ----------
  1146. * Extension types that were cimported from other Cython modules could disagree
  1147. about the order of fused cdef methods in their call table. This could lead
  1148. to wrong methods being called and potentially also crashes. The fix required
  1149. changes to the ordering of fused methods in the call table, which may break
  1150. existing compiled modules that call fused cdef methods across module boundaries,
  1151. if these methods were implemented in a different order than they were declared
  1152. in the corresponding .pxd file. (Github issue #1873)
  1153. * The exception state handling in generators and coroutines could lead to
  1154. exceptions in the caller being lost if an exception was raised and handled
  1155. inside of the coroutine when yielding. (Github issue #1731)
  1156. * Loops over ``range(enum)`` were not converted into C for-loops. Note that it
  1157. is still recommended to use an explicit cast to a C integer type in this case.
  1158. * Error positions of names (e.g. variables) were incorrectly reported after the
  1159. name and not at the beginning of the name.
  1160. * Compile time ``DEF`` assignments were evaluated even when they occur inside of
  1161. falsy ``IF`` blocks. (Github issue #1796)
  1162. * Disabling the line tracing from a trace function could fail.
  1163. Original patch by Dmitry Trofimov. (Github issue #1769)
  1164. * Several issues with the Pythran integration were resolved.
  1165. * abs(signed int) now returns a signed rather than unsigned int.
  1166. (Github issue #1837)
  1167. * Reading ``frame.f_locals`` of a Cython function (e.g. from a debugger or profiler
  1168. could modify the module globals. (Github issue #1836)
  1169. * Buffer type mismatches in the NumPy buffer support could leak a reference to the
  1170. buffer owner.
  1171. * Using the "is_f_contig" and "is_c_contig" memoryview methods together could leave
  1172. one of them undeclared. (Github issue #1872)
  1173. * Compilation failed if the for-in-range loop target was not a variable but a more
  1174. complex expression, e.g. an item assignment. (Github issue #1831)
  1175. * Compile time evaluations of (partially) constant f-strings could show incorrect
  1176. results.
  1177. * Escape sequences in raw f-strings (``fr'...'``) were resolved instead of passing
  1178. them through as expected.
  1179. * Some ref-counting issues in buffer error handling have been resolved.
  1180. Other changes
  1181. -------------
  1182. * Type declarations in signature annotations are now parsed according to
  1183. `PEP 484 <https://www.python.org/dev/peps/pep-0484/>`_
  1184. typing. Only Cython types (e.g. ``cython.int``) and Python builtin types are
  1185. currently considered as type declarations. Everything else is ignored, but this
  1186. will change in a future Cython release.
  1187. (Github issue #1672)
  1188. * The directive ``annotation_typing`` is now ``True`` by default, which enables
  1189. parsing type declarations from annotations.
  1190. * This release no longer supports Python 3.2.
  1191. 0.26.1 (2017-08-29)
  1192. ===================
  1193. Features added
  1194. --------------
  1195. Bugs fixed
  1196. ----------
  1197. * ``cython.view.array`` was missing ``.__len__()``.
  1198. * Extension types with a ``.pxd`` override for their ``__releasebuffer__`` slot
  1199. (e.g. as provided by Cython for the Python ``array.array`` type) could leak
  1200. a reference to the buffer owner on release, thus not freeing the memory.
  1201. (Github issue #1638)
  1202. * Auto-decoding failed in 0.26 for strings inside of C++ containers.
  1203. (Github issue #1790)
  1204. * Compile error when inheriting from C++ container types.
  1205. (Github issue #1788)
  1206. * Invalid C code in generators (declaration after code).
  1207. (Github issue #1801)
  1208. * Arithmetic operations on ``const`` integer variables could generate invalid code.
  1209. (Github issue #1798)
  1210. * Local variables with names of special Python methods failed to compile inside of
  1211. closures. (Github issue #1797)
  1212. * Problem with indirect Emacs buffers in cython-mode.
  1213. Patch by Martin Albrecht (Github issue #1743).
  1214. * Extension types named ``result`` or ``PickleError`` generated invalid unpickling code.
  1215. Patch by Jason Madden (Github issue #1786).
  1216. * Bazel integration failed to compile ``.py`` files.
  1217. Patch by Guro Bokum (Github issue #1784).
  1218. * Some include directories and dependencies were referenced with their absolute paths
  1219. in the generated files despite lying within the project directory.
  1220. * Failure to compile in Py3.7 due to a modified signature of ``_PyCFunctionFast()``
  1221. 0.26 (2017-07-19)
  1222. =================
  1223. Features added
  1224. --------------
  1225. * Pythran can be used as a backend for evaluating NumPy array expressions.
  1226. Patch by Adrien Guinet (Github issue #1607).
  1227. * cdef classes now support pickling by default when possible.
  1228. This can be disabled with the ``auto_pickle`` directive.
  1229. * Speed up comparisons of strings if their hash value is available.
  1230. Patch by Claudio Freire (Github issue #1571).
  1231. * Support pyximport from zip files.
  1232. Patch by Sergei Lebedev (Github issue #1485).
  1233. * IPython magic now respects the ``__all__`` variable and ignores
  1234. names with leading-underscore (like ``import *`` does).
  1235. Patch by Syrtis Major (Github issue #1625).
  1236. * ``abs()`` is optimised for C complex numbers.
  1237. Patch by da-woods (Github issue #1648).
  1238. * The display of C lines in Cython tracebacks can now be enabled at runtime
  1239. via ``import cython_runtime; cython_runtime.cline_in_traceback=True``.
  1240. The default has been changed to False.
  1241. * The overhead of calling fused types generic functions was reduced.
  1242. * "cdef extern" include files are now also searched relative to the current file.
  1243. Patch by Jeroen Demeyer (Github issue #1654).
  1244. * Optional optimization for re-aquiring the GIL, controlled by the
  1245. `fast_gil` directive.
  1246. Bugs fixed
  1247. ----------
  1248. * Item lookup/assignment with a unicode character as index that is typed
  1249. (explicitly or implicitly) as ``Py_UCS4`` or ``Py_UNICODE`` used the
  1250. integer value instead of the Unicode string value. Code that relied on
  1251. the previous behaviour now triggers a warning that can be disabled by
  1252. applying an explicit cast. (Github issue #1602)
  1253. * f-string processing was adapted to changes in PEP 498 and CPython 3.6.
  1254. * Invalid C code when decoding from UTF-16(LE/BE) byte strings.
  1255. (Github issue #1696)
  1256. * Unicode escapes in 'ur' raw-unicode strings were not resolved in Py2 code.
  1257. Original patch by Aaron Gallagher (Github issue #1594).
  1258. * File paths of code objects are now relative.
  1259. Original patch by Jelmer Vernooij (Github issue #1565).
  1260. * Decorators of cdef class methods could be executed twice.
  1261. Patch by Jeroen Demeyer (Github issue #1724).
  1262. * Dict iteration using the Py2 ``iter*`` methods failed in PyPy3.
  1263. Patch by Armin Rigo (Github issue #1631).
  1264. * Several warnings in the generated code are now suppressed.
  1265. Other changes
  1266. -------------
  1267. * The ``unraisable_tracebacks`` option now defaults to ``True``.
  1268. * Coercion of C++ containers to Python is no longer automatic on attribute
  1269. access (Github issue #1521).
  1270. * Access to Python attributes of cimported modules without the corresponding
  1271. import is now a compile-time (rather than runtime) error.
  1272. * Do not use special dll linkage for "cdef public" functions.
  1273. Patch by Jeroen Demeyer (Github issue #1687).
  1274. * cdef/cpdef methods must match their declarations. See Github Issue #1732.
  1275. This is now a warning and will be an error in future releases.
  1276. 0.25.2 (2016-12-08)
  1277. ===================
  1278. Bugs fixed
  1279. ----------
  1280. * Fixes several issues with C++ template deduction.
  1281. * Fixes a issue with bound method type inference (Github issue #551).
  1282. * Fixes a bug with cascaded tuple assignment (Github issue #1523).
  1283. * Fixed or silenced many Clang warnings.
  1284. * Fixes bug with powers of pure real complex numbers (Github issue #1538).
  1285. 0.25.1 (2016-10-26)
  1286. ===================
  1287. Bugs fixed
  1288. ----------
  1289. * Fixes a bug with ``isinstance(o, Exception)`` (Github issue #1496).
  1290. * Fixes bug with ``cython.view.array`` missing utility code in some cases
  1291. (Github issue #1502).
  1292. Other changes
  1293. -------------
  1294. * The distutils extension ``Cython.Distutils.build_ext`` has been reverted,
  1295. temporarily, to be ``old_build_ext`` to give projects time to migrate.
  1296. The new build_ext is available as ``new_build_ext``.
  1297. 0.25 (2016-10-25)
  1298. =================
  1299. Features added
  1300. --------------
  1301. * def/cpdef methods of cdef classes benefit from Cython's internal function
  1302. implementation, which enables introspection and line profiling for them.
  1303. Implementation sponsored by Turbostream (www.turbostream-cfd.com).
  1304. * Calls to Python functions are faster, following the recent "FastCall"
  1305. optimisations that Victor Stinner implemented for CPython 3.6.
  1306. See https://bugs.python.org/issue27128 and related issues.
  1307. * The new METH_FASTCALL calling convention for PyCFunctions is supported
  1308. in CPython 3.6. See https://bugs.python.org/issue27810
  1309. * Initial support for using Cython modules in Pyston.
  1310. Patch by Boxiang Sun.
  1311. * Dynamic Python attributes are allowed on cdef classes if an attribute
  1312. ``cdef dict __dict__`` is declared in the class. Patch by empyrical.
  1313. * Cython implemented C++ classes can make direct calls to base class methods.
  1314. Patch by empyrical.
  1315. * C++ classes can now have typedef members. STL containers updated with
  1316. value_type.
  1317. * New directive ``cython.no_gc`` to fully disable GC for a cdef class.
  1318. Patch by Claudio Freire.
  1319. * Buffer variables are no longer excluded from ``locals()``.
  1320. Patch by da-woods.
  1321. * Building f-strings is faster, especially when formatting C integers.
  1322. * for-loop iteration over "std::string".
  1323. * ``libc/math.pxd`` provides ``e`` and ``pi`` as alias constants to simplify
  1324. usage as a drop-in replacement for Python's math module.
  1325. * Speed up cython.inline().
  1326. * Binary lshift operations with small constant Python integers are faster.
  1327. * Some integer operations on Python long objects are faster in Python 2.7.
  1328. * Support for the C++ ``typeid`` operator.
  1329. * Support for bazel using a the pyx_library rule in //Tools:rules.bzl.
  1330. Significant Bugs fixed
  1331. ----------------------
  1332. * Division of complex numbers avoids overflow by using Smith's method.
  1333. * Some function signatures in ``libc.math`` and ``numpy.pxd`` were incorrect.
  1334. Patch by Michael Seifert.
  1335. Other changes
  1336. -------------
  1337. * The "%%cython" IPython/jupyter magic now defaults to the language level of
  1338. the current jupyter kernel. The language level can be set explicitly with
  1339. "%%cython -2" or "%%cython -3".
  1340. * The distutils extension ``Cython.Distutils.build_ext`` has now been updated
  1341. to use cythonize which properly handles dependencies. The old extension can
  1342. still be found in ``Cython.Distutils.old_build_ext`` and is now deprecated.
  1343. * ``directive_defaults`` is no longer available in ``Cython.Compiler.Options``,
  1344. use ``get_directive_defaults()`` instead.
  1345. 0.24.1 (2016-07-15)
  1346. ===================
  1347. Bugs fixed
  1348. ----------
  1349. * IPython cell magic was lacking a good way to enable Python 3 code semantics.
  1350. It can now be used as "%%cython -3".
  1351. * Follow a recent change in `PEP 492 <https://www.python.org/dev/peps/pep-0492/>`_
  1352. and CPython 3.5.2 that now requires the ``__aiter__()`` method of asynchronous
  1353. iterators to be a simple ``def`` method instead of an ``async def`` method.
  1354. * Coroutines and generators were lacking the ``__module__`` special attribute.
  1355. * C++ ``std::complex`` values failed to auto-convert from and to Python complex
  1356. objects.
  1357. * Namespaced C++ types could not be used as memory view types due to lack of
  1358. name mangling. Patch by Ivan Smirnov.
  1359. * Assignments between identical C++ types that were declared with differently
  1360. typedefed template types could fail.
  1361. * Rebuilds could fail to evaluate dependency timestamps in C++ mode.
  1362. Patch by Ian Henriksen.
  1363. * Macros defined in the ``distutils`` compiler option do not require values
  1364. anymore. Patch by Ian Henriksen.
  1365. * Minor fixes for MSVC, Cygwin and PyPy.
  1366. 0.24 (2016-04-04)
  1367. =================
  1368. Features added
  1369. --------------
  1370. * `PEP 498 <https://www.python.org/dev/peps/pep-0498/>`_:
  1371. Literal String Formatting (f-strings).
  1372. Original patch by Jelle Zijlstra.
  1373. * `PEP 515 <https://www.python.org/dev/peps/pep-0515/>`_:
  1374. Underscores as visual separators in number literals.
  1375. * Parser was adapted to some minor syntax changes in Py3.6, e.g.
  1376. https://bugs.python.org/issue9232
  1377. * The embedded C code comments that show the original source code
  1378. can be discarded with the new directive ``emit_code_comments=False``.
  1379. * Cpdef enums are now first-class iterable, callable types in Python.
  1380. * Ctuples can now be declared in pure Python code.
  1381. * Posix declarations for DLL loading and stdio extensions were added.
  1382. Patch by Lars Buitinck.
  1383. * The Py2-only builtins ``unicode()``, ``xrange()``, ``reduce()`` and
  1384. ``long`` are now also available in compile time ``DEF`` expressions
  1385. when compiling with Py3.
  1386. * Exception type tests have slightly lower overhead.
  1387. This fixes ticket 868.
  1388. * @property syntax fully supported in cdef classes, old syntax deprecated.
  1389. * C++ classes can now be declared with default template parameters.
  1390. Bugs fixed
  1391. ----------
  1392. * C++ exceptions raised by overloaded C++ operators were not always
  1393. handled. Patch by Ian Henriksen.
  1394. * C string literals were previously always stored as non-const global
  1395. variables in the module. They are now stored as global constants
  1396. when possible, and otherwise as non-const C string literals in the
  1397. generated code that uses them. This improves compatibility with
  1398. strict C compiler options and prevents non-const strings literals
  1399. with the same content from being incorrectly merged.
  1400. * Compile time evaluated ``str`` expressions (``DEF``) now behave in a
  1401. more useful way by turning into Unicode strings when compiling under
  1402. Python 3. This allows using them as intermediate values in expressions.
  1403. Previously, they always evaluated to bytes objects.
  1404. * ``isinf()`` declarations in ``libc/math.pxd`` and ``numpy/math.pxd`` now
  1405. reflect the actual tristate ``int`` return value instead of using ``bint``.
  1406. * Literal assignments to ctuples avoid Python tuple round-trips in some
  1407. more corner cases.
  1408. * Iteration over ``dict(...).items()`` failed to get optimised when dict
  1409. arguments included keyword arguments.
  1410. * cProfile now correctly profiles cpdef functions and methods.
  1411. 0.23.5 (2016-03-26)
  1412. ===================
  1413. * Compile errors and warnings in integer type conversion code. This fixes
  1414. ticket 877. Patches by Christian Neukirchen, Nikolaus Rath, Ian Henriksen.
  1415. * Reference leak when "*args" argument was reassigned in closures.
  1416. * Truth-testing Unicode strings could waste time and memory in Py3.3+.
  1417. * Return values of async functions could be ignored and replaced by ``None``.
  1418. * Compiler crash in CPython 3.6.
  1419. * Fix prange() to behave identically to range(). The end condition was
  1420. miscalculated when the range was not exactly divisible by the step.
  1421. * Optimised ``all(genexpr)``/``any(genexpr)`` calls could warn about unused
  1422. code. This fixes ticket 876.
  1423. 0.23.4 (2015-10-10)
  1424. ===================
  1425. Bugs fixed
  1426. ----------
  1427. * Memory leak when calling Python functions in PyPy.
  1428. * Compilation problem with MSVC in C99-ish mode.
  1429. * Warning about unused values in a helper macro.
  1430. 0.23.3 (2015-09-29)
  1431. ===================
  1432. Bugs fixed
  1433. ----------
  1434. * Invalid C code for some builtin methods. This fixes ticket 856 again.
  1435. * Incorrect C code in helper functions for PyLong conversion and string
  1436. decoding. This fixes ticket 863, ticket 864 and ticket 865.
  1437. Original patch by Nikolaus Rath.
  1438. * Large folded or inserted integer constants could use too small C
  1439. integer types and thus trigger a value wrap-around.
  1440. Other changes
  1441. -------------
  1442. * The coroutine and generator types of Cython now also register directly
  1443. with the ``Coroutine`` and ``Generator`` ABCs in the ``backports_abc``
  1444. module if it can be imported. This fixes ticket 870.
  1445. 0.23.2 (2015-09-11)
  1446. ===================
  1447. Bugs fixed
  1448. ----------
  1449. * Compiler crash when analysing some optimised expressions.
  1450. * Coverage plugin was adapted to coverage.py 4.0 beta 2.
  1451. * C++ destructor calls could fail when '&' operator is overwritten.
  1452. * Incorrect C literal generation for large integers in compile-time
  1453. evaluated DEF expressions and constant folded expressions.
  1454. * Byte string constants could end up as Unicode strings when originating
  1455. from compile-time evaluated DEF expressions.
  1456. * Invalid C code when caching known builtin methods.
  1457. This fixes ticket 860.
  1458. * ``ino_t`` in ``posix.types`` was not declared as ``unsigned``.
  1459. * Declarations in ``libcpp/memory.pxd`` were missing ``operator!()``.
  1460. Patch by Leo Razoumov.
  1461. * Static cdef methods can now be declared in .pxd files.
  1462. 0.23.1 (2015-08-22)
  1463. ===================
  1464. Bugs fixed
  1465. ----------
  1466. * Invalid C code for generators. This fixes ticket 858.
  1467. * Invalid C code for some builtin methods. This fixes ticket 856.
  1468. * Invalid C code for unused local buffer variables.
  1469. This fixes ticket 154.
  1470. * Test failures on 32bit systems. This fixes ticket 857.
  1471. * Code that uses ``from xyz import *`` and global C struct/union/array
  1472. variables could fail to compile due to missing helper functions.
  1473. This fixes ticket 851.
  1474. * Misnamed PEP 492 coroutine property ``cr_yieldfrom`` renamed to
  1475. ``cr_await`` to match CPython.
  1476. * Missing deallocation code for C++ object attributes in certain
  1477. extension class hierarchies.
  1478. * Crash when async coroutine was not awaited.
  1479. * Compiler crash on ``yield`` in signature annotations and default
  1480. argument values. Both are forbidden now.
  1481. * Compiler crash on certain constructs in ``finally`` clauses.
  1482. * Cython failed to build when CPython's pgen is installed.
  1483. 0.23 (2015-08-08)
  1484. =================
  1485. Features added
  1486. --------------
  1487. * `PEP 492 <https://www.python.org/dev/peps/pep-0492/>`_
  1488. (async/await) was implemented.
  1489. * `PEP 448 <https://www.python.org/dev/peps/pep-0448/>`_
  1490. (Additional Unpacking Generalizations) was implemented.
  1491. * Support for coverage.py 4.0+ can be enabled by adding the plugin
  1492. "Cython.Coverage" to the ".coveragerc" config file.
  1493. * Annotated HTML source pages can integrate (XML) coverage reports.
  1494. * Tracing is supported in ``nogil`` functions/sections and module init code.
  1495. * When generators are used in a Cython module and the module imports the
  1496. modules "inspect" and/or "asyncio", Cython enables interoperability by
  1497. patching these modules during the import to recognise Cython's internal
  1498. generator and coroutine types. This can be disabled by C compiling the
  1499. module with "-D CYTHON_PATCH_ASYNCIO=0" or "-D CYTHON_PATCH_INSPECT=0"
  1500. * When generators or coroutines are used in a Cython module, their types
  1501. are registered with the ``Generator`` and ``Coroutine`` ABCs in the
  1502. ``collections`` or ``collections.abc`` stdlib module at import time to
  1503. enable interoperability with code that needs to detect and process Python
  1504. generators/coroutines. These ABCs were added in CPython 3.5 and are
  1505. available for older Python versions through the ``backports_abc`` module
  1506. on PyPI. See https://bugs.python.org/issue24018
  1507. * Adding/subtracting/dividing/modulus and equality comparisons with
  1508. constant Python floats and small integers are faster.
  1509. * Binary and/or/xor/rshift operations with small constant Python integers
  1510. are faster.
  1511. * When called on generator expressions, the builtins ``all()``, ``any()``,
  1512. ``dict()``, ``list()``, ``set()``, ``sorted()`` and ``unicode.join()``
  1513. avoid the generator iteration overhead by inlining a part of their
  1514. functionality into the for-loop.
  1515. * Keyword argument dicts are no longer copied on function entry when they
  1516. are not being used or only passed through to other function calls (e.g.
  1517. in wrapper functions).
  1518. * The ``PyTypeObject`` declaration in ``cpython.object`` was extended.
  1519. * The builtin ``type`` type is now declared as PyTypeObject in source,
  1520. allowing for extern functions taking type parameters to have the correct
  1521. C signatures. Note that this might break code that uses ``type`` just
  1522. for passing around Python types in typed variables. Removing the type
  1523. declaration provides a backwards compatible fix.
  1524. * ``wraparound()`` and ``boundscheck()`` are available as no-ops in pure
  1525. Python mode.
  1526. * Const iterators were added to the provided C++ STL declarations.
  1527. * Smart pointers were added to the provided C++ STL declarations.
  1528. Patch by Daniel Filonik.
  1529. * ``NULL`` is allowed as default argument when embedding signatures.
  1530. This fixes ticket 843.
  1531. * When compiling with ``--embed``, the internal module name is changed to
  1532. ``__main__`` to allow arbitrary program names, including those that would
  1533. be invalid for modules. Note that this prevents reuse of the generated
  1534. C code as an importable module.
  1535. * External C++ classes that overload the assignment operator can be used.
  1536. Patch by Ian Henriksen.
  1537. * Support operator bool() for C++ classes so they can be used in if statements.
  1538. Bugs fixed
  1539. ----------
  1540. * Calling "yield from" from Python on a Cython generator that returned a
  1541. value triggered a crash in CPython. This is now being worked around.
  1542. See https://bugs.python.org/issue23996
  1543. * Language level 3 did not enable true division (a.k.a. float division)
  1544. for integer operands.
  1545. * Functions with fused argument types that included a generic 'object'
  1546. fallback could end up using that fallback also for other explicitly
  1547. listed object types.
  1548. * Relative cimports could accidentally fall back to trying an absolute
  1549. cimport on failure.
  1550. * The result of calling a C struct constructor no longer requires an
  1551. intermediate assignment when coercing to a Python dict.
  1552. * C++ exception declarations with mapping functions could fail to compile
  1553. when pre-declared in .pxd files.
  1554. * ``cpdef void`` methods are now permitted.
  1555. * ``abs(cint)`` could fail to compile in MSVC and used sub-optimal code
  1556. in C++. Patch by David Vierra, original patch by Michael Enßlin.
  1557. * Buffer index calculations using index variables with small C integer
  1558. types could overflow for large buffer sizes.
  1559. Original patch by David Vierra.
  1560. * C unions use a saner way to coerce from and to Python dicts.
  1561. * When compiling a module ``foo.pyx``, the directories in ``sys.path``
  1562. are no longer searched when looking for ``foo.pxd``.
  1563. Patch by Jeroen Demeyer.
  1564. * Memory leaks in the embedding main function were fixed.
  1565. Original patch by Michael Enßlin.
  1566. * Some complex Python expressions could fail to compile inside of finally
  1567. clauses.
  1568. * Unprefixed 'str' literals were not supported as C varargs arguments.
  1569. * Fixed type errors in conversion enum types to/from Python. Note that
  1570. this imposes stricter correctness requirements on enum declarations.
  1571. Other changes
  1572. -------------
  1573. * Changed mangling scheme in header files generated by ``cdef api``
  1574. declarations.
  1575. * Installation under CPython 3.3+ no longer requires a pass of the
  1576. 2to3 tool. This also makes it possible to run Cython in Python
  1577. 3.3+ from a source checkout without installing it first.
  1578. Patch by Petr Viktorin.
  1579. * ``jedi-typer.py`` (in ``Tools/``) was extended and renamed to
  1580. ``jedityper.py`` (to make it importable) and now works with and
  1581. requires Jedi 0.9. Patch by Tzer-jen Wei.
  1582. 0.22.1 (2015-06-20)
  1583. ===================
  1584. Bugs fixed
  1585. ----------
  1586. * Crash when returning values on generator termination.
  1587. * In some cases, exceptions raised during internal isinstance() checks were
  1588. not propagated.
  1589. * Runtime reported file paths of source files (e.g for profiling and tracing)
  1590. are now relative to the build root directory instead of the main source file.
  1591. * Tracing exception handling code could enter the trace function with an active
  1592. exception set.
  1593. * The internal generator function type was not shared across modules.
  1594. * Comparisons of (inferred) ctuples failed to compile.
  1595. * Closures inside of cdef functions returning ``void`` failed to compile.
  1596. * Using ``const`` C++ references in intermediate parts of longer expressions
  1597. could fail to compile.
  1598. * C++ exception declarations with mapping functions could fail to compile when
  1599. pre-declared in .pxd files.
  1600. * C++ compilation could fail with an ambiguity error in recent MacOS-X Xcode
  1601. versions.
  1602. * C compilation could fail in pypy3.
  1603. * Fixed a memory leak in the compiler when compiling multiple modules.
  1604. * When compiling multiple modules, external library dependencies could leak
  1605. into later compiler runs. Fix by Jeroen Demeyer. This fixes ticket 845.
  1606. 0.22 (2015-02-11)
  1607. =================
  1608. Features added
  1609. --------------
  1610. * C functions can coerce to Python functions, which allows passing them
  1611. around as callable objects.
  1612. * C arrays can be assigned by value and auto-coerce from Python iterables
  1613. and to Python lists (and tuples).
  1614. * Extern C functions can now be declared as cpdef to export them to
  1615. the module's Python namespace. Extern C functions in pxd files export
  1616. their values to their own module, iff it exists.
  1617. * Anonymous C tuple types can be declared as (ctype1, ctype2, ...).
  1618. * `PEP 479 <https://www.python.org/dev/peps/pep-0479/>`_:
  1619. turn accidental StopIteration exceptions that exit generators
  1620. into a RuntimeError, activated with future import "generator_stop".
  1621. * Looping over ``reversed(range())`` is optimised in the same way as
  1622. ``range()``. Patch by Favian Contreras.
  1623. Bugs fixed
  1624. ----------
  1625. * Mismatching 'except' declarations on signatures in .pxd and .pyx files failed
  1626. to produce a compile error.
  1627. * Failure to find any files for the path pattern(s) passed into ``cythonize()``
  1628. is now an error to more easily detect accidental typos.
  1629. * The ``logaddexp`` family of functions in ``numpy.math`` now has correct
  1630. declarations.
  1631. * In Py2.6/7 and Py3.2, simple Cython memory views could accidentally be
  1632. interpreted as non-contiguous by CPython, which could trigger a CPython
  1633. bug when copying data from them, thus leading to data corruption.
  1634. See CPython issues 12834 and 23349.
  1635. Other changes
  1636. -------------
  1637. * Preliminary support for defining the Cython language with a formal grammar.
  1638. To try parsing your files against this grammar, use the --formal_grammar directive.
  1639. Experimental.
  1640. * ``_`` is no longer considered a cacheable builtin as it could interfere with
  1641. gettext.
  1642. * Cythonize-computed metadata now cached in the generated C files.
  1643. * Several corrections and extensions in numpy, cpython, and libcpp pxd files.
  1644. 0.21.2 (2014-12-27)
  1645. ===================
  1646. Bugs fixed
  1647. ----------
  1648. * Crash when assigning a C value to both a Python and C target at the same time.
  1649. * Automatic coercion from C++ strings to ``str`` generated incomplete code that
  1650. failed to compile.
  1651. * Declaring a constructor in a C++ child class erroneously required a default
  1652. constructor declaration in the super class.
  1653. * ``resize_smart()`` in ``cpython.array`` was broken.
  1654. * Functions in ``libcpp.cast`` are now declared as ``nogil``.
  1655. * Some missing C-API declarations were added.
  1656. * Py3 main code in embedding program code was lacking casts.
  1657. * Exception related to distutils "Distribution" class type in pyximport under
  1658. latest CPython 2.7 and 3.4 releases when setuptools is being imported later.
  1659. 0.21.1 (2014-10-18)
  1660. ===================
  1661. Features added
  1662. --------------
  1663. * New ``cythonize`` option ``-a`` to generate the annotated HTML source view.
  1664. * Missing C-API declarations in ``cpython.unicode`` were added.
  1665. * Passing ``language='c++'`` into cythonize() globally enables C++ mode for
  1666. all modules that were not passed as Extension objects (i.e. only source
  1667. files and file patterns).
  1668. * ``Py_hash_t`` is a known type (used in CPython for hash values).
  1669. * ``PySlice_*()`` C-API functions are available from the ``cpython.slice``
  1670. module.
  1671. * Allow arrays of C++ classes.
  1672. Bugs fixed
  1673. ----------
  1674. * Reference leak for non-simple Python expressions in boolean and/or expressions.
  1675. * To fix a name collision and to reflect availability on host platforms,
  1676. standard C declarations [ clock(), time(), struct tm and tm* functions ]
  1677. were moved from posix/time.pxd to a new libc/time.pxd. Patch by Charles
  1678. Blake.
  1679. * Rerunning unmodified modules in IPython's cython support failed.
  1680. Patch by Matthias Bussonier.
  1681. * Casting C++ ``std::string`` to Python byte strings failed when
  1682. auto-decoding was enabled.
  1683. * Fatal exceptions in global module init code could lead to crashes
  1684. if the already created module was used later on (e.g. through a
  1685. stale reference in sys.modules or elsewhere).
  1686. * ``cythonize.py`` script was not installed on MS-Windows.
  1687. Other changes
  1688. -------------
  1689. * Compilation no longer fails hard when unknown compilation options are
  1690. passed. Instead, it raises a warning and ignores them (as it did silently
  1691. before 0.21). This will be changed back to an error in a future release.
  1692. 0.21 (2014-09-10)
  1693. =================
  1694. Features added
  1695. --------------
  1696. * C (cdef) functions allow inner Python functions.
  1697. * Enums can now be declared as cpdef to export their values to
  1698. the module's Python namespace. Cpdef enums in pxd files export
  1699. their values to their own module, iff it exists.
  1700. * Allow @staticmethod decorator to declare static cdef methods.
  1701. This is especially useful for declaring "constructors" for
  1702. cdef classes that can take non-Python arguments.
  1703. * Taking a ``char*`` from a temporary Python string object is safer
  1704. in more cases and can be done inside of non-trivial expressions,
  1705. including arguments of a function call. A compile time error
  1706. is raised only when such a pointer is assigned to a variable and
  1707. would thus exceed the lifetime of the string itself.
  1708. * Generators have new properties ``__name__`` and ``__qualname__``
  1709. that provide the plain/qualified name of the generator function
  1710. (following CPython 3.5). See http://bugs.python.org/issue21205
  1711. * The ``inline`` function modifier is available as a decorator
  1712. ``@cython.inline`` in pure mode.
  1713. * When cygdb is run in a virtualenv, it enables the same virtualenv
  1714. inside of the debugger. Patch by Marc Abramowitz.
  1715. * PEP 465: dedicated infix operator for matrix multiplication (A @ B).
  1716. * HTML output of annotated code uses Pygments for code highlighting
  1717. and generally received a major overhaul by Matthias Bussonier.
  1718. * IPython magic support is now available directly from Cython with
  1719. the command "%load_ext cython". Cython code can directly be
  1720. executed in a cell when marked with "%%cython". Code analysis
  1721. is available with "%%cython -a". Patch by Martín Gaitán.
  1722. * Simple support for declaring Python object types in Python signature
  1723. annotations. Currently requires setting the compiler directive
  1724. ``annotation_typing=True``.
  1725. * New directive ``use_switch`` (defaults to True) to optionally disable
  1726. the optimization of chained if statement to C switch statements.
  1727. * Defines dynamic_cast et al. in ``libcpp.cast`` and C++ heap data
  1728. structure operations in ``libcpp.algorithm``.
  1729. * Shipped header declarations in ``posix.*`` were extended to cover
  1730. more of the POSIX API. Patches by Lars Buitinck and Mark Peek.
  1731. Optimizations
  1732. -------------
  1733. * Simple calls to C implemented Python functions/methods are faster.
  1734. This also speeds up many operations on builtins that Cython cannot
  1735. otherwise optimise.
  1736. * The "and"/"or" operators try to avoid unnecessary coercions of their
  1737. arguments. They now evaluate the truth value of each argument
  1738. independently and only coerce the final result of the whole expression
  1739. to the target type (e.g. the type on the left side of an assignment).
  1740. This also avoids reference counting overhead for Python values during
  1741. evaluation and generally improves the code flow in the generated C code.
  1742. * The Python expression "2 ** N" is optimised into bit shifting.
  1743. See http://bugs.python.org/issue21420
  1744. * Cascaded assignments (a = b = ...) try to minimise the number of
  1745. type coercions.
  1746. * Calls to ``slice()`` are translated to a straight C-API call.
  1747. Bugs fixed
  1748. ----------
  1749. * Crash when assigning memory views from ternary conditional expressions.
  1750. * Nested C++ templates could lead to unseparated ">>" characters being
  1751. generated into the C++ declarations, which older C++ compilers could
  1752. not parse.
  1753. * Sending SIGINT (Ctrl-C) during parallel cythonize() builds could
  1754. hang the child processes.
  1755. * No longer ignore local setup.cfg files for distutils in pyximport.
  1756. Patch by Martin Teichmann.
  1757. * Taking a ``char*`` from an indexed Python string generated unsafe
  1758. reference counting code.
  1759. * Set literals now create all of their items before trying to add them
  1760. to the set, following the behaviour in CPython. This makes a
  1761. difference in the rare case that the item creation has side effects
  1762. and some items are not hashable (or if hashing them has side effects,
  1763. too).
  1764. * Cython no longer generates the cross product of C functions for code
  1765. that uses memory views of fused types in function signatures (e.g.
  1766. ``cdef func(floating[:] a, floating[:] b)``). This is considered the
  1767. expected behaviour by most users and was previously inconsistent with
  1768. other structured types like C arrays. Code that really wants all type
  1769. combinations can create the same fused memoryview type under different
  1770. names and use those in the signature to make it clear which types are
  1771. independent.
  1772. * Names that were unknown at compile time were looked up as builtins at
  1773. runtime but not as global module names. Trying both lookups helps with
  1774. globals() manipulation.
  1775. * Fixed stl container conversion for typedef element types.
  1776. * ``obj.pop(x)`` truncated large C integer values of x to ``Py_ssize_t``.
  1777. * ``__init__.pyc`` is recognised as marking a package directory
  1778. (in addition to .py, .pyx and .pxd).
  1779. * Syntax highlighting in ``cython-mode.el`` for Emacs no longer
  1780. incorrectly highlights keywords found as part of longer names.
  1781. * Correctly handle ``from cython.submodule cimport name``.
  1782. * Fix infinite recursion when using super with cpdef methods.
  1783. * No-args ``dir()`` was not guaranteed to return a sorted list.
  1784. Other changes
  1785. -------------
  1786. * The header line in the generated C files no longer contains the
  1787. timestamp but only the Cython version that wrote it. This was
  1788. changed to make builds more reproducible.
  1789. * Removed support for CPython 2.4, 2.5 and 3.1.
  1790. * The licensing implications on the generated code were clarified
  1791. to avoid legal constraints for users.
  1792. 0.20.2 (2014-06-16)
  1793. ===================
  1794. Features added
  1795. --------------
  1796. * Some optimisations for set/frozenset instantiation.
  1797. * Support for C++ unordered_set and unordered_map.
  1798. Bugs fixed
  1799. ----------
  1800. * Access to attributes of optimised builtin methods (e.g.
  1801. ``[].append.__name__``) could fail to compile.
  1802. * Memory leak when extension subtypes add a memory view as attribute
  1803. to those of the parent type without having Python object attributes
  1804. or a user provided dealloc method.
  1805. * Compiler crash on readonly properties in "binding" mode.
  1806. * Auto-encoding with ``c_string_encoding=ascii`` failed in Py3.3.
  1807. * Crash when subtyping freelist enabled Cython extension types with
  1808. Python classes that use ``__slots__``.
  1809. * Freelist usage is restricted to CPython to avoid problems with other
  1810. Python implementations.
  1811. * Memory leak in memory views when copying overlapping, contiguous slices.
  1812. * Format checking when requesting non-contiguous buffers from
  1813. ``cython.array`` objects was accidentally omitted in Py3.
  1814. * C++ destructor calls in extension types could fail to compile in clang.
  1815. * Buffer format validation failed for sequences of strings in structs.
  1816. * Docstrings on extension type attributes in .pxd files were rejected.
  1817. 0.20.1 (2014-02-11)
  1818. ===================
  1819. Bugs fixed
  1820. ----------
  1821. * Build error under recent MacOS-X versions where ``isspace()`` could not be
  1822. resolved by clang.
  1823. * List/Tuple literals multiplied by more than one factor were only multiplied
  1824. by the last factor instead of all.
  1825. * Lookups of special methods (specifically for context managers) could fail
  1826. in Python <= 2.6/3.1.
  1827. * Local variables were erroneously appended to the signature introspection
  1828. of Cython implemented functions with keyword-only arguments under Python 3.
  1829. * In-place assignments to variables with inferred Python builtin/extension
  1830. types could fail with type errors if the result value type was incompatible
  1831. with the type of the previous value.
  1832. * The C code generation order of cdef classes, closures, helper code,
  1833. etc. was not deterministic, thus leading to high code churn.
  1834. * Type inference could fail to deduce C enum types.
  1835. * Type inference could deduce unsafe or inefficient types from integer
  1836. assignments within a mix of inferred Python variables and integer
  1837. variables.
  1838. 0.20 (2014-01-18)
  1839. =================
  1840. Features added
  1841. --------------
  1842. * Support for CPython 3.4.
  1843. * Support for calling C++ template functions.
  1844. * ``yield`` is supported in ``finally`` clauses.
  1845. * The C code generated for finally blocks is duplicated for each exit
  1846. case to allow for better optimisations by the C compiler.
  1847. * Cython tries to undo the Python optimisationism of assigning a bound
  1848. method to a local variable when it can generate better code for the
  1849. direct call.
  1850. * Constant Python float values are cached.
  1851. * String equality comparisons can use faster type specific code in
  1852. more cases than before.
  1853. * String/Unicode formatting using the '%' operator uses a faster
  1854. C-API call.
  1855. * ``bytearray`` has become a known type and supports coercion from and
  1856. to C strings. Indexing, slicing and decoding is optimised. Note that
  1857. this may have an impact on existing code due to type inference.
  1858. * Using ``cdef basestring stringvar`` and function arguments typed as
  1859. ``basestring`` is now meaningful and allows assigning exactly
  1860. ``str`` and ``unicode`` objects, but no subtypes of these types.
  1861. * Support for the ``__debug__`` builtin.
  1862. * Assertions in Cython compiled modules are disabled if the running
  1863. Python interpreter was started with the "-O" option.
  1864. * Some types that Cython provides internally, such as functions and
  1865. generators, are now shared across modules if more than one Cython
  1866. implemented module is imported.
  1867. * The type inference algorithm works more fine granular by taking the
  1868. results of the control flow analysis into account.
  1869. * A new script in ``bin/cythonize`` provides a command line frontend
  1870. to the cythonize() compilation function (including distutils build).
  1871. * The new extension type decorator ``@cython.no_gc_clear`` prevents
  1872. objects from being cleared during cyclic garbage collection, thus
  1873. making sure that object attributes are kept alive until deallocation.
  1874. * During cyclic garbage collection, attributes of extension types that
  1875. cannot create reference cycles due to their type (e.g. strings) are
  1876. no longer considered for traversal or clearing. This can reduce the
  1877. processing overhead when searching for or cleaning up reference cycles.
  1878. * Package compilation (i.e. ``__init__.py`` files) now works, starting
  1879. with Python 3.3.
  1880. * The cython-mode.el script for Emacs was updated. Patch by Ivan Andrus.
  1881. * An option common_utility_include_dir was added to cythonize() to save
  1882. oft-used utility code once in a separate directory rather than as
  1883. part of each generated file.
  1884. * ``unraisable_tracebacks`` directive added to control printing of
  1885. tracebacks of unraisable exceptions.
  1886. Bugs fixed
  1887. ----------
  1888. * Abstract Python classes that subtyped a Cython extension type
  1889. failed to raise an exception on instantiation, and thus ended
  1890. up being instantiated.
  1891. * ``set.add(a_tuple)`` and ``set.discard(a_tuple)`` failed with a
  1892. TypeError in Py2.4.
  1893. * The PEP 3155 ``__qualname__`` was incorrect for nested classes and
  1894. inner classes/functions declared as ``global``.
  1895. * Several corner cases in the try-finally statement were fixed.
  1896. * The metaclass of a Python class was not inherited from its parent
  1897. class(es). It is now extracted from the list of base classes if not
  1898. provided explicitly using the Py3 ``metaclass`` keyword argument.
  1899. In Py2 compilation mode, a ``__metaclass__`` entry in the class
  1900. dict will still take precedence if not using Py3 metaclass syntax,
  1901. but only *after* creating the class dict (which may have been done
  1902. by a metaclass of a base class, see PEP 3115). It is generally
  1903. recommended to use the explicit Py3 syntax to define metaclasses
  1904. for Python types at compile time.
  1905. * The automatic C switch statement generation behaves more safely for
  1906. heterogeneous value types (e.g. mixing enum and char), allowing for
  1907. a slightly wider application and reducing corner cases. It now always
  1908. generates a 'default' clause to avoid C compiler warnings about
  1909. unmatched enum values.
  1910. * Fixed a bug where class hierarchies declared out-of-order could result
  1911. in broken generated code.
  1912. * Fixed a bug which prevented overriding const methods of C++ classes.
  1913. * Fixed a crash when converting Python objects to C++ strings fails.
  1914. Other changes
  1915. -------------
  1916. * In Py3 compilation mode, Python2-style metaclasses declared by a
  1917. ``__metaclass__`` class dict entry are ignored.
  1918. * In Py3.4+, the Cython generator type uses ``tp_finalize()`` for safer
  1919. cleanup instead of ``tp_del()``.
  1920. 0.19.2 (2013-10-13)
  1921. ===================
  1922. Features added
  1923. --------------
  1924. Bugs fixed
  1925. ----------
  1926. * Some standard declarations were fixed or updated, including the previously
  1927. incorrect declaration of ``PyBuffer_FillInfo()`` and some missing bits in
  1928. ``libc.math``.
  1929. * Heap allocated subtypes of ``type`` used the wrong base type struct at the
  1930. C level.
  1931. * Calling the unbound method dict.keys/value/items() in dict subtypes could
  1932. call the bound object method instead of the unbound supertype method.
  1933. * "yield" wasn't supported in "return" value expressions.
  1934. * Using the "bint" type in memory views lead to unexpected results.
  1935. It is now an error.
  1936. * Assignments to global/closure variables could catch them in an illegal state
  1937. while deallocating the old value.
  1938. Other changes
  1939. -------------
  1940. 0.19.1 (2013-05-11)
  1941. ===================
  1942. Features added
  1943. --------------
  1944. * Completely empty C-API structs for extension type slots (protocols like
  1945. number/mapping/sequence) are no longer generated into the C code.
  1946. * Docstrings that directly follow a public/readonly attribute declaration
  1947. in a cdef class will be used as docstring of the auto-generated property.
  1948. This fixes ticket 206.
  1949. * The automatic signature documentation tries to preserve more semantics
  1950. of default arguments and argument types. Specifically, ``bint`` arguments
  1951. now appear as type ``bool``.
  1952. * A warning is emitted when negative literal indices are found inside of
  1953. a code section that disables ``wraparound`` handling. This helps with
  1954. fixing invalid code that might fail in the face of future compiler
  1955. optimisations.
  1956. * Constant folding for boolean expressions (and/or) was improved.
  1957. * Added a build_dir option to cythonize() which allows one to place
  1958. the generated .c files outside the source tree.
  1959. Bugs fixed
  1960. ----------
  1961. * ``isinstance(X, type)`` failed to get optimised into a call to
  1962. ``PyType_Check()``, as done for other builtin types.
  1963. * A spurious ``from datetime cimport *`` was removed from the "cpython"
  1964. declaration package. This means that the "datetime" declarations
  1965. (added in 0.19) are no longer available directly from the "cpython"
  1966. namespace, but only from "cpython.datetime". This is the correct
  1967. way of doing it because the declarations refer to a standard library
  1968. module, not the core CPython C-API itself.
  1969. * The C code for extension types is now generated in topological order
  1970. instead of source code order to avoid C compiler errors about missing
  1971. declarations for subtypes that are defined before their parent.
  1972. * The ``memoryview`` type name no longer shows up in the module dict of
  1973. modules that use memory views. This fixes trac ticket 775.
  1974. * Regression in 0.19 that rejected valid C expressions from being used
  1975. in C array size declarations.
  1976. * In C++ mode, the C99-only keyword ``restrict`` could accidentally be
  1977. seen by the GNU C++ compiler. It is now specially handled for both
  1978. GCC and MSVC.
  1979. * Testing large (> int) C integer values for their truth value could fail
  1980. due to integer wrap-around.
  1981. Other changes
  1982. -------------
  1983. 0.19 (2013-04-19)
  1984. =================
  1985. Features added
  1986. --------------
  1987. * New directives ``c_string_type`` and ``c_string_encoding`` to more easily
  1988. and automatically convert between C strings and the different Python string
  1989. types.
  1990. * The extension type flag ``Py_TPFLAGS_HAVE_VERSION_TAG`` is enabled by default
  1991. on extension types and can be disabled using the ``type_version_tag`` compiler
  1992. directive.
  1993. * EXPERIMENTAL support for simple Cython code level line tracing. Enabled by
  1994. the "linetrace" compiler directive.
  1995. * Cython implemented functions make their argument and return type annotations
  1996. available through the ``__annotations__`` attribute (PEP 3107).
  1997. * Access to non-cdef module globals and Python object attributes is faster.
  1998. * ``Py_UNICODE*`` coerces from and to Python unicode strings. This is
  1999. helpful when talking to Windows APIs, which use compatible wchar_t
  2000. arrays for strings. Note that the ``Py_UNICODE`` type is otherwise
  2001. deprecated as of CPython 3.3.
  2002. * ``isinstance(obj, basestring)`` is optimised. In Python 3 it only tests
  2003. for instances of ``str`` (i.e. Py2 ``unicode``).
  2004. * The ``basestring`` builtin is mapped to ``str`` (i.e. Py2 ``unicode``) when
  2005. compiling the generated C code under Python 3.
  2006. * Closures use freelists, which can speed up their creation quite substantially.
  2007. This is also visible for short running generator expressions, for example.
  2008. * A new class decorator ``@cython.freelist(N)`` creates a static freelist of N
  2009. instances for an extension type, thus avoiding the costly allocation step if
  2010. possible. This can speed up object instantiation by 20-30% in suitable
  2011. scenarios. Note that freelists are currently only supported for base types,
  2012. not for types that inherit from others.
  2013. * Fast extension type instantiation using the ``Type.__new__(Type)`` idiom has
  2014. gained support for passing arguments. It is also a bit faster for types defined
  2015. inside of the module.
  2016. * The Python2-only dict methods ``.iter*()`` and ``.view*()`` (requires Python 2.7)
  2017. are automatically mapped to the equivalent keys/values/items methods in Python 3
  2018. for typed dictionaries.
  2019. * Slicing unicode strings, lists and tuples is faster.
  2020. * list.append() is faster on average.
  2021. * ``raise Exception() from None`` suppresses the exception context in Py3.3.
  2022. * Py3 compatible ``exec(tuple)`` syntax is supported in Py2 code.
  2023. * Keyword arguments are supported for cdef functions.
  2024. * External C++ classes can be declared nogil. Patch by John Stumpo. This fixes
  2025. trac ticket 805.
  2026. Bugs fixed
  2027. ----------
  2028. * 2-value slicing of unknown objects passes the correct slice when the ``getitem``
  2029. protocol is used instead of the ``getslice`` protocol (especially in Python 3),
  2030. i.e. ``None`` values for missing bounds instead of ``[0,maxsize]``. It is also
  2031. a bit faster in some cases, e.g. for constant bounds. This fixes trac ticket 636.
  2032. * Cascaded assignments of None values to extension type variables failed with
  2033. a ``TypeError`` at runtime.
  2034. * The ``__defaults__`` attribute was not writable for Cython implemented
  2035. functions.
  2036. * Default values of keyword-only arguments showed up in ``__defaults__`` instead
  2037. of ``__kwdefaults__`` (which was not implemented). Both are available for
  2038. Cython implemented functions now, as specified in Python 3.x.
  2039. * ``yield`` works inside of ``with gil`` sections. It previously lead to a crash.
  2040. This fixes trac ticket 803.
  2041. * Static methods without explicitly named positional arguments (e.g. having only
  2042. ``*args``) crashed when being called. This fixes trac ticket 804.
  2043. * ``dir()`` without arguments previously returned an unsorted list, which now
  2044. gets sorted as expected.
  2045. * ``dict.items()``, ``dict.keys()`` and ``dict.values()`` no longer return lists
  2046. in Python 3.
  2047. * Exiting from an ``except-as`` clause now deletes the exception in Python 3 mode.
  2048. * The declarations of ``frexp()`` and ``ldexp()`` in ``math.pxd`` were incorrect.
  2049. Other changes
  2050. -------------
  2051. 0.18 (2013-01-28)
  2052. =================
  2053. Features added
  2054. --------------
  2055. * Named Unicode escapes ("\N{...}") are supported.
  2056. * Python functions/classes provide the special attribute "__qualname__"
  2057. as defined by PEP 3155.
  2058. * Added a directive ``overflowcheck`` which raises an OverflowException when
  2059. arithmetic with C ints overflow. This has a modest performance penalty, but
  2060. is much faster than using Python ints.
  2061. * Calls to nested Python functions are resolved at compile time.
  2062. * Type inference works across nested functions.
  2063. * ``py_bytes_string.decode(...)`` is optimised.
  2064. * C ``const`` declarations are supported in the language.
  2065. Bugs fixed
  2066. ----------
  2067. * Automatic C++ exception mapping didn't work in nogil functions (only in
  2068. "with nogil" blocks).
  2069. Other changes
  2070. -------------
  2071. 0.17.4 (2013-01-03)
  2072. ===================
  2073. Bugs fixed
  2074. ----------
  2075. * Garbage collection triggered during deallocation of container classes could lead to a double-deallocation.
  2076. 0.17.3 (2012-12-14)
  2077. ===================
  2078. Features added
  2079. --------------
  2080. Bugs fixed
  2081. ----------
  2082. * During final interpreter cleanup (with types cleanup enabled at compile time), extension types that inherit from base types over more than one level that were cimported from other modules could lead to a crash.
  2083. * Weak-reference support in extension types (with a ``cdef __weakref__`` attribute) generated incorrect deallocation code.
  2084. * In CPython 3.3, converting a Unicode character to the Py_UNICODE type could fail to raise an overflow for non-BMP characters that do not fit into a wchar_t on the current platform.
  2085. * Negative C integer constants lost their longness suffix in the generated C code.
  2086. Other changes
  2087. -------------
  2088. 0.17.2 (2012-11-20)
  2089. ===================
  2090. Features added
  2091. --------------
  2092. * ``cythonize()`` gained a best effort compile mode that can be used to simply ignore .py files that fail to compile.
  2093. Bugs fixed
  2094. ----------
  2095. * Replacing an object reference with the value of one of its cdef attributes could generate incorrect C code that accessed the object after deleting its last reference.
  2096. * C-to-Python type coercions during cascaded comparisons could generate invalid C code, specifically when using the 'in' operator.
  2097. * "obj[1,]" passed a single integer into the item getter instead of a tuple.
  2098. * Cyclic imports at module init time did not work in Py3.
  2099. * The names of C++ destructors for template classes were built incorrectly.
  2100. * In pure mode, type casts in Cython syntax and the C ampersand operator are now rejected. Use the pure mode replacements instead.
  2101. * In pure mode, C type names and the sizeof() function are no longer recognised as such and can be used as normal Python names.
  2102. * The extended C level support for the CPython array type was declared too late to be used by user defined classes.
  2103. * C++ class nesting was broken.
  2104. * Better checking for required nullary constructors for stack-allocated C++ instances.
  2105. * Remove module docstring in no-docstring mode.
  2106. * Fix specialization for varargs function signatures.
  2107. * Fix several compiler crashes.
  2108. Other changes
  2109. -------------
  2110. * An experimental distutils script for compiling the CPython standard library was added as Tools/cystdlib.py.
  2111. 0.17.1 (2012-09-26)
  2112. ===================
  2113. Features added
  2114. --------------
  2115. Bugs fixed
  2116. ----------
  2117. * A reference leak was fixed in the new dict iteration code when the loop target was not a plain variable but an unpacked tuple.
  2118. * Memory views did not handle the special case of a NULL buffer strides value, as allowed by PEP3118.
  2119. Other changes
  2120. -------------
  2121. 0.17 (2012-09-01)
  2122. =================
  2123. Features added
  2124. --------------
  2125. * Alpha quality support for compiling and running Cython generated extension modules in PyPy (through cpyext). Note that this requires at least PyPy 1.9 and in many cases also adaptations in user code, especially to avoid borrowed references when no owned reference is being held directly in C space (a reference in a Python list or dict is not enough, for example). See the documentation on porting Cython code to PyPy.
  2126. * "yield from" is supported (PEP 380) and a couple of minor problems with generators were fixed.
  2127. * C++ STL container classes automatically coerce from and to the equivalent Python container types on typed assignments and casts. Note that the data in the containers is copied during this conversion.
  2128. * C++ iterators can now be iterated over using "for x in cpp_container" whenever cpp_container has begin() and end() methods returning objects satisfying the iterator pattern (that is, it can be incremented, dereferenced, and compared (for non-equality)).
  2129. * cdef classes can now have C++ class members (provided a zero-argument constructor exists)
  2130. * A new cpython.array standard cimport file allows to efficiently talk to the stdlib array.array data type in Python 2. Since CPython does not export an official C-API for this module, it receives special casing by the compiler in order to avoid setup overhead on user side. In Python 3, both buffers and memory views on the array type already worked out of the box with earlier versions of Cython due to the native support for the buffer interface in the Py3 array module.
  2131. * Fast dict iteration is now enabled optimistically also for untyped variables when the common iteration methods are used.
  2132. * The unicode string processing code was adapted for the upcoming CPython 3.3 (PEP 393, new Unicode buffer layout).
  2133. * Buffer arguments and memory view arguments in Python functions can be declared "not None" to raise a TypeError on None input.
  2134. * c(p)def functions in pure mode can specify their return type with "@cython.returns()".
  2135. * Automatic dispatch for fused functions with memoryview arguments
  2136. * Support newaxis indexing for memoryviews
  2137. * Support decorators for fused functions
  2138. Bugs fixed
  2139. ----------
  2140. * Old-style Py2 imports did not work reliably in Python 3.x and were broken in Python 3.3. Regardless of this fix, it's generally best to be explicit about relative and global imports in Cython code because old-style imports have a higher overhead. To this end, "from __future__ import absolute_import" is supported in Python/Cython 2.x code now (previous versions of Cython already used it when compiling Python 3 code).
  2141. * Stricter constraints on the "inline" and "final" modifiers. If your code does not compile due to this change, chances are these modifiers were previously being ignored by the compiler and can be removed without any performance regression.
  2142. * Exceptions are always instantiated while raising them (as in Python), instead of risking to instantiate them in potentially unsafe situations when they need to be handled or otherwise processed.
  2143. * locals() properly ignores names that do not have Python compatible types (including automatically inferred types).
  2144. * Some garbage collection issues of memory views were fixed.
  2145. * numpy.pxd compiles in Python 3 mode.
  2146. * Several C compiler warnings were fixed.
  2147. * Several bugs related to memoryviews and fused types were fixed.
  2148. * Several bug-fixes and improvements related to cythonize(), including ccache-style caching.
  2149. Other changes
  2150. -------------
  2151. * libc.string provides a convenience declaration for const uchar in addition to const char.
  2152. * User declared char* types are now recognised as such and auto-coerce to and from Python bytes strings.
  2153. * callable() and next() compile to more efficient C code.
  2154. * list.append() is faster on average.
  2155. * Modules generated by @cython.inline() are written into the directory pointed to by the environment variable CYTHON_CACHE_DIR if set.
  2156. 0.16 (2012-04-21)
  2157. =================
  2158. Features added
  2159. --------------
  2160. * Enhancements to Cython's function type (support for weak references, default arguments, code objects, dynamic attributes, classmethods, staticmethods, and more)
  2161. * Fused Types - Template-like support for functions and methods CEP 522 (docs)
  2162. * Typed views on memory - Support for efficient direct and indirect buffers (indexing, slicing, transposing, ...) CEP 517 (docs)
  2163. * super() without arguments
  2164. * Final cdef methods (which translate into direct calls on known instances)
  2165. Bugs fixed
  2166. ----------
  2167. * fix alignment handling for record types in buffer support
  2168. Other changes
  2169. -------------
  2170. * support default arguments for closures
  2171. * search sys.path for pxd files
  2172. * support C++ template casting
  2173. * faster traceback building and faster generator termination
  2174. * support inplace operators on indexed buffers
  2175. * allow nested prange sections
  2176. 0.15.1 (2011-09-19)
  2177. ===================
  2178. Features added
  2179. --------------
  2180. Bugs fixed
  2181. ----------
  2182. Other changes
  2183. -------------
  2184. 0.15 (2011-08-05)
  2185. =================
  2186. Features added
  2187. --------------
  2188. * Generators (yield) - Cython has full support for generators, generator expressions and PEP 342 coroutines.
  2189. * The nonlocal keyword is supported.
  2190. * Re-acquiring the gil: with gil - works as expected within a nogil context.
  2191. * OpenMP support: prange.
  2192. * Control flow analysis prunes dead code and emits warnings and errors about uninitialised variables.
  2193. * Debugger command cy set to assign values of expressions to Cython variables and cy exec counterpart $cy_eval().
  2194. * Exception chaining PEP 3134.
  2195. * Relative imports PEP 328.
  2196. * Improved pure syntax including cython.cclass, cython.cfunc, and cython.ccall.
  2197. * The with statement has its own dedicated and faster C implementation.
  2198. * Support for del.
  2199. * Boundschecking directives implemented for builtin Python sequence types.
  2200. * Several updates and additions to the shipped standard library .pxd files.
  2201. * Forward declaration of types is no longer required for circular references.
  2202. Bugs fixed
  2203. ----------
  2204. Other changes
  2205. -------------
  2206. * Uninitialized variables are no longer initialized to None and accessing them has the same semantics as standard Python.
  2207. * globals() now returns a read-only dict of the Cython module's globals, rather than the globals of the first non-Cython module in the stack
  2208. * Many C++ exceptions are now special cased to give closer Python counterparts. This means that except+ functions that formerly raised generic RuntimeErrors may raise something else such as ArithmeticError.
  2209. * The inlined generator expressions (introduced in Cython 0.13) were disabled in favour of full generator expression support. This breaks code that previously used them inside of cdef functions (usage in def functions continues to work) and induces a performance regression for cases that continue to work but that were previously inlined. We hope to reinstate this feature in the near future.
  2210. 0.14.1 (2011-02-04)
  2211. ===================
  2212. Features added
  2213. --------------
  2214. * The gdb debugging support was extended to include all major Cython features, including closures.
  2215. * raise MemoryError() is now safe to use as Cython replaces it with the correct C-API call.
  2216. Bugs fixed
  2217. ----------
  2218. Other changes
  2219. -------------
  2220. * Decorators on special methods of cdef classes now raise a compile time error rather than being ignored.
  2221. * In Python 3 language level mode (-3 option), the 'str' type is now mapped to 'unicode', so that cdef str s declares a Unicode string even when running in Python 2.
  2222. 0.14 (2010-12-14)
  2223. =================
  2224. Features added
  2225. --------------
  2226. * Python classes can now be nested and receive a proper closure at definition time.
  2227. * Redefinition is supported for Python functions, even within the same scope.
  2228. * Lambda expressions are supported in class bodies and at the module level.
  2229. * Metaclasses are supported for Python classes, both in Python 2 and Python 3 syntax. The Python 3 syntax (using a keyword argument in the type declaration) is preferred and optimised at compile time.
  2230. * "final" extension classes prevent inheritance in Python space. This feature is available through the new "cython.final" decorator. In the future, these classes may receive further optimisations.
  2231. * "internal" extension classes do not show up in the module dictionary. This feature is available through the new "cython.internal" decorator.
  2232. * Extension type inheritance from builtin types, such as "cdef class MyUnicode(unicode)", now works without further external type redeclarations (which are also strongly discouraged now and continue to issue a warning).
  2233. * GDB support. http://docs.cython.org/src/userguide/debugging.html
  2234. * A new build system with support for inline distutils directives, correct dependency tracking, and parallel compilation. https://github.com/cython/cython/wiki/enhancements-distutils_preprocessing
  2235. * Support for dynamic compilation at runtime via the new cython.inline function and cython.compile decorator. https://github.com/cython/cython/wiki/enhancements-inline
  2236. * "nogil" blocks are supported when compiling pure Python code by writing "with cython.nogil".
  2237. * Iterating over arbitrary pointer types is now supported, as is an optimized version of the in operator, e.g. x in ptr[a:b].
  2238. Bugs fixed
  2239. ----------
  2240. * In parallel assignments, the right side was evaluated in reverse order in 0.13. This could result in errors if it had side effects (e.g. function calls).
  2241. * In some cases, methods of builtin types would raise a SystemError instead of an AttributeError when called on None.
  2242. Other changes
  2243. -------------
  2244. * Constant tuples are now cached over the lifetime of an extension module, just like CPython does. Constant argument tuples of Python function calls are also cached.
  2245. * Closures have tightened to include exactly the names used in the inner functions and classes. Previously, they held the complete locals of the defining function.
  2246. * The builtin "next()" function in Python 2.6 and later is now implemented internally and therefore available in all Python versions. This makes it the preferred and portable way of manually advancing an iterator.
  2247. * In addition to the previously supported inlined generator expressions in 0.13, "sorted(genexpr)" can now be used as well. Typing issues were fixed in "sum(genexpr)" that could lead to invalid C code being generated. Other known issues with inlined generator expressions were also fixed that make upgrading to 0.14 a strong recommendation for code that uses them. Note that general generators and generator expressions continue to be not supported.
  2248. * Inplace arithmetic operators now respect the cdivision directive and are supported for complex types.
  2249. * Typing a variable as type "complex" previously gave it the Python object type. It now uses the appropriate C/C++ double complex type. A side-effect is that assignments and typed function parameters now accept anything that Python can coerce to a complex, including integers and floats, and not only complex instances.
  2250. * Large integer literals pass through the compiler in a safer way. To prevent truncation in C code, non 32-bit literals are turned into Python objects if not used in a C context. This context can either be given by a clear C literal suffix such as "UL" or "LL" (or "L" in Python 3 code), or it can be an assignment to a typed variable or a typed function argument, in which case it is up to the user to take care of a sufficiently large value space of the target.
  2251. * Python functions are declared in the order they appear in the file, rather than all being created at module creation time. This is consistent with Python and needed to support, for example, conditional or repeated declarations of functions. In the face of circular imports this may cause code to break, so a new --disable-function-redefinition flag was added to revert to the old behavior. This flag will be removed in a future release, so should only be used as a stopgap until old code can be fixed.
  2252. 0.13 (2010-08-25)
  2253. =================
  2254. Features added
  2255. --------------
  2256. * Closures are fully supported for Python functions. Cython supports inner functions and lambda expressions. Generators and generator expressions are not supported in this release.
  2257. * Proper C++ support. Cython knows about C++ classes, templates and overloaded function signatures, so that Cython code can interact with them in a straight forward way.
  2258. * Type inference is enabled by default for safe C types (e.g. double, bint, C++ classes) and known extension types. This reduces the need for explicit type declarations and can improve the performance of untyped code in some cases. There is also a verbose compile mode for testing the impact on user code.
  2259. * Cython's for-in-loop can iterate over C arrays and sliced pointers. The type of the loop variable will be inferred automatically in this case.
  2260. * The Py_UNICODE integer type for Unicode code points is fully supported, including for-loops and 'in' tests on unicode strings. It coerces from and to single character unicode strings. Note that untyped for-loop variables will automatically be inferred as Py_UNICODE when iterating over a unicode string. In most cases, this will be much more efficient than yielding sliced string objects, but can also have a negative performance impact when the variable is used in a Python context multiple times, so that it needs to coerce to a unicode string object more than once. If this happens, typing the loop variable as unicode or object will help.
  2261. * The built-in functions any(), all(), sum(), list(), set() and dict() are inlined as plain for loops when called on generator expressions. Note that generator expressions are not generally supported apart from this feature. Also, tuple(genexpr) is not currently supported - use tuple([listcomp]) instead.
  2262. * More shipped standard library declarations. The python_* and stdlib/stdio .pxd files have been deprecated in favor of clib.* and cpython[.*] and may get removed in a future release.
  2263. * Pure Python mode no longer disallows non-Python keywords like 'cdef', 'include' or 'cimport'. It also no longer recognises syntax extensions like the for-from loop.
  2264. * Parsing has improved for Python 3 syntax in Python code, although not all features are correctly supported. The missing Python 3 features are being worked on for the next release.
  2265. * from __future__ import print_function is supported in Python 2.6 and later. Note that there is currently no emulation for earlier Python versions, so code that uses print() with this future import will require at least Python 2.6.
  2266. * New compiler directive language_level (valid values: 2 or 3) with corresponding command line options -2 and -3 requests source code compatibility with Python 2.x or Python 3.x respectively. Language level 3 currently enforces unicode literals for unprefixed string literals, enables the print function (requires Python 2.6 or later) and keeps loop variables in list comprehensions from leaking.
  2267. * Loop variables in set/dict comprehensions no longer leak into the surrounding scope (following Python 2.7). List comprehensions are unchanged in language level 2.
  2268. * print >> stream
  2269. Bugs fixed
  2270. ----------
  2271. Other changes
  2272. -------------
  2273. * The availability of type inference by default means that Cython will also infer the type of pointers on assignments. Previously, code like this::
  2274. cdef char* s = ...
  2275. untyped_variable = s
  2276. would convert the char* to a Python bytes string and assign that. This is no longer the case and no coercion will happen in the example above. The correct way of doing this is through an explicit cast or by typing the target variable, i.e.
  2277. ::
  2278. cdef char* s = ...
  2279. untyped_variable1 = <bytes>s
  2280. untyped_variable2 = <object>s
  2281. cdef object py_object = s
  2282. cdef bytes bytes_string = s
  2283. * bool is no longer a valid type name by default. The problem is that it's not clear whether bool should refer to the Python type or the C++ type, and expecting one and finding the other has already led to several hard-to-find bugs. Both types are available for importing: you can use from cpython cimport bool for the Python bool type, and from libcpp cimport bool for the C++ type. bool is still a valid object by default, so one can still write bool(x).
  2284. * ``__getsegcount__`` is now correctly typed to take a ``Py_size_t*`` rather than an ``int*``.
  2285. 0.12.1 (2010-02-02)
  2286. ===================
  2287. Features added
  2288. --------------
  2289. * Type inference improvements.
  2290. * There have been several bug fixes and improvements to the type inferencer.
  2291. * Notably, there is now a "safe" mode enabled by setting the infer_types directive to None. (The None here refers to the "default" mode, which will be the default in 0.13.) This safe mode limits inference to Python object types and C doubles, which should speed up execution without affecting any semantics such as integer overflow behavior like infer_types=True might. There is also an infer_types.verbose option which allows one to see what types are inferred.
  2292. * The boundscheck directive works for lists and tuples as well as buffers.
  2293. * len(s) and s.decode("encoding") are efficiently supported for char* s.
  2294. * Cython's INLINE macro has been renamed to CYTHON_INLINE to reduce conflict and has better support for the MSVC compiler on Windows. It is no longer clobbered if externally defined.
  2295. * Revision history is now omitted from the source package, resulting in a 85% size reduction. Running make repo will download the history and turn the directory into a complete Mercurial working repository.
  2296. * Cython modules don't need to be recompiled when the size of an external type grows. (A warning, rather than an error, is produced.) This should be helpful for binary distributions relying on NumPy.
  2297. Bugs fixed
  2298. ----------
  2299. * Several other bugs and minor improvements have been made. This release should be fully backwards compatible with 0.12.
  2300. Other changes
  2301. -------------
  2302. 0.12 (2009-11-23)
  2303. =================
  2304. Features added
  2305. --------------
  2306. * Type inference with the infer_types directive
  2307. * Seamless C++ complex support
  2308. * Fast extension type instantiation using the normal Python meme obj = MyType.__new__(MyType)
  2309. * Improved support for Py3.1
  2310. * Cython now runs under Python 3.x using the 2to3 tool
  2311. * unittest support for doctests in Cython modules
  2312. * Optimised handling of C strings (char*): for c in cstring[2:50] and cstring.decode()
  2313. * Looping over c pointers: for i in intptr[:50].
  2314. * pyximport improvements
  2315. * cython_freeze improvements
  2316. Bugs fixed
  2317. ----------
  2318. * Many bug fixes
  2319. Other changes
  2320. -------------
  2321. * Many other optimisation, e.g. enumerate() loops, parallel swap assignments (a,b = b,a), and unicode.encode()
  2322. * More complete numpy.pxd
  2323. 0.11.2 (2009-05-20)
  2324. ===================
  2325. Features added
  2326. --------------
  2327. * There's now native complex floating point support! C99 complex will be used if complex.h is included, otherwise explicit complex arithmetic working on all C compilers is used. [Robert Bradshaw]
  2328. ::
  2329. cdef double complex a = 1 + 0.3j
  2330. cdef np.ndarray[np.complex128_t, ndim=2] arr = \
  2331. np.zeros(10, np.complex128)
  2332. * Cython can now generate a main()-method for embedding of the Python interpreter into an executable (see #289) [Robert Bradshaw]
  2333. * @wraparound directive (another way to disable arr[idx] for negative idx) [Dag Sverre Seljebotn]
  2334. * Correct support for NumPy record dtypes with different alignments, and "cdef packed struct" support [Dag Sverre Seljebotn]
  2335. * @callspec directive, allowing custom calling convention macros [Lisandro Dalcin]
  2336. Bugs fixed
  2337. ----------
  2338. Other changes
  2339. -------------
  2340. * Bug fixes and smaller improvements. For the full list, see [1].