Knowledge (XXG)

Cython

Source 📝

303:, producing C source files compatible with CPython 2.6, 2.7, and 3.3 and later versions. The Cython source code that Cython compiles (to C) can use both Python 2 and Python 3 syntax, defaulting to Python 2 syntax in Cython 0.x (and Python 3 syntax in Cython 3.x). The default can be overridden (e.g. in source code comment) to Python 3 (or 2) syntax. Since Python 3 syntax has changed in recent versions, Cython may not be up to date with the latest additions. Cython has "native support for most of the C++ language" and "compiles almost all existing Python code". 1866: 201: 83: 683: 2013: 36: 1251:
def accelerate(self, amount=20): # Method to increase speed and reduce fuel if self.fuel > 0: self.speed += amount self.fuel -= amount * 0.1 # Fuel decreases as the car accelerates self.fuel = max(self.fuel, 0) # Ensure fuel doesn’t go below 0
318:
Although most of the code is C-based, a small stub loader written in interpreted Python is usually required (unless the goal is to create a loader written entirely in C, which may involve work with the undocumented internals of CPython). However, this is not a major problem due to the presence of the
1281:
my_bugatti.display_info() # Show Bugatti details my_bugatti.accelerate() # Accelerate the Bugatti my_bugatti.accelerate(50) # Accelerate by a custom amount my_bugatti.brake(30) # Slow down the car my_bugatti.stop() # Stop the car my_bugatti.refuel() # Refuel the car
314:
Cython works by producing a standard Python module. However, the behavior differs from standard Python in that the module code, originally written in Python, is translated into C. While the resulting code is fast, it makes many calls into the CPython interpreter and CPython standard libraries to
344:
A Cython program that implements the same algorithm as a corresponding Python program may consume fewer computing resources such as core memory and processing cycles due to differences between the CPython and Cython execution models. A basic Python program is loaded and executed by the CPython
392:
computer algebra package, because they were unhappy with Pyrex's limitations and could not get patches accepted by Pyrex's maintainer Greg Ewing, who envisioned a much smaller scope for his tool than the Sage developers had in mind. They then forked Pyrex as SageX. When they found people were
1247:
def __init__(self, model, year): # Initialize the Bugatti with make, model, year, speed, and fuel level self.make = "Bugatti" self.model = model self.year = year self.speed = 0 # Speed starts at 0 self.fuel = 100 # Fuel starts full at 100%
1255:
def brake(self, amount=20): # Method to decrease speed if self.speed - amount < 0: self.speed = 0 else: self.speed -= amount print(f"The Bugatti slows down by {amount} km/h. Current speed: {self.speed} km/h")
349:, so both the runtime and the program itself consume computing resources. A Cython program is compiled to C code, which is further compiled to machine code, so the virtual machine is used only briefly when the program is loaded. 1252:
print(f"The Bugatti accelerates by {amount} km/h. Current speed: {self.speed} km/h, Fuel: {self.fuel:.1f}%") else: print("The Bugatti is out of fuel and cannot accelerate.")
1902: 2152: 2060: 1265:
def display_info(self): # Display the car's details print(f"Car Info: {self.year} {self.make} {self.model}, Current Speed: {self.speed} km/h, Fuel: {self.fuel:.1f}%")
315:
perform actual work. Choosing this arrangement saved considerably on Cython's development time, but modules have a dependency on the Python interpreter and standard library.
1816: 284:, producing extension modules that can be loaded and used by regular Python code using the import statement, but with significantly less computational overhead at 1895: 412:, in Cython, types can optionally be provided, allowing for improved performance, allowing loops to be converted into C loops where possible. For example: 2157: 1632: 2147: 1888: 2083: 1441: 265:, which allows developers to write Python code (with optional, C-inspired syntax extensions) that yields performance comparable to that of 2162: 1921: 2021: 285: 1665: 1262:
def refuel(self): # Refuel the Bugatti to 100% self.fuel = 100 print("The Bugatti has been refueled to 100%.")
1379: 1241:
which gives a 95 times improvement over the pure-python version. More details on the subject in the official quickstart page.
691: 1533: 1911: 262: 217: 140: 2078: 381: 385: 107: 75: 2120: 323: 393:
downloading Sage just to get SageX, and developers of other packages (including Stefan Behnel, who maintains the
372:
Performance depends both on what C code is generated by Cython and how that code is compiled by the C compiler.
1259:
def stop(self): # Method to stop the car self.speed = 0 print("The Bugatti has stopped.")
327: 266: 213: 1691: 408:
extension. At its most basic, Cython code looks exactly like Python code. However, whereas standard Python is
1555:
Behnel, Stefan; Bradshaw, Robert; Citro, Craig; Dalcin, Lisandro; Seljebotn, Dag Sverre; Smith, Kurt (2011).
2114: 2000: 1507: 1640: 694:
program for Cython is more complex than in most languages because it interfaces with the Python C API and
397:
library LXML) were also maintaining forks of Pyrex, SageX was split off the Sage project and merged with
682: 2093: 1759: 1568: 1830: 82: 1790: 1594: 871: 702:-compliant extension building facilities. At least three files are required for a basic project: 179: 172: 43: 1785:
Says Sage and Cython developer Robert Bradshaw at the Sage Days 29 conference (22 March 2011).
2125: 2054: 1810: 1437: 1433: 292: 273: 288:. Cython also facilitates wrapping independent C or C++ code into python-importable modules. 2101: 1989: 1631:
Wilbers, I.; Langtangen, H. P.; Ødegård, Å. (2009). Skallerud, B.; Andersson, H. I. (eds.).
1613: 1584: 1576: 1356: 699: 231: 167: 147: 1482: 2029: 1994: 1669: 346: 281: 1334: 1738: 1572: 1979: 1865: 1316: 409: 359: 200: 1404: 280:
extension modules. Annotated Python-like code is compiled to C and then automatically
2141: 1929: 1598: 1427: 2012: 1556: 1949: 338: 1959: 1786: 1760:"Re: VM and Language summit info for those not at Pycon (and those that are!)" 334: 341:
of subroutine parameters and results, local variables, and class attributes.
2039: 1984: 757:# launch.py - Python stub loader, loads the module that was made by Cython. 1666:"wrapper benchmarks for several Python wrapper generators (except Cython)" 1580: 1934: 729:# hello.pyx - Python module, this code will be translated to C by Cython. 389: 384:, but it supports more features and optimizations than Pyrex. Cython was 258: 866:
A more straightforward way to start with Cython is through command-line
35: 2044: 1939: 1802: 1589: 867: 277: 152: 17: 724:
The following code listings demonstrate the build and launch process:
1964: 1875: 1743: 1534:"Technical Discovery: Speeding up Python (NumPy, Cython, and Weave)" 1457: 331: 2049: 1969: 1954: 1296: 788:# setup.py - unnecessary if not redistributing the code, see below 681: 300: 296: 160: 156: 2034: 1974: 1618:
Proceedings of the 8th Python in Science Conference (SciPy 2009)
1291: 1884: 1717: 1695: 394: 417:# The argument will be converted to int or raise a TypeError. 1871: 243: 1692:"wrapper benchmarks for Cython, Boost.Python and PyBindGen" 240: 246: 1880: 1282:
my_bugatti.display_info() # Show final Bugatti details
1323:(28 July 2007: official Cython launch). Vilnius/Lietuva. 125: 99: 760:# This code is always interpreted, like normal Python. 1859: 870:(or through in-browser python console called Jupyter 857:$ pythonsetup.pybuild_ext--inplace $ pythonlaunch.py 249: 237: 193: 1633:"Using Cython to Speed up Numerical Python Programs" 1405:"Cython - an overview — Cython 0.19.1 documentation" 2092: 2071: 2020: 1920: 234: 207: 188: 178: 166: 146: 136: 106: 74: 52: 42: 717:A main python program to load the extension module 714:build process that generates the extension module 1380:"Language Basics — Cython 3.0.0a9 documentation" 1317:"The Cython Compiler for C-Extensions in Python" 291:Cython is written in Python and C and works on 2153:Python (programming language) implementations 1896: 1508:"Basic Tutorial — Cython 3.0a6 documentation" 853:These commands build and launch the program: 8: 438:# These variables are declared with C types. 28: 1815:: CS1 maint: numeric names: authors list ( 306:Cython 3.0.0 was released on 17 July 2023. 1903: 1889: 1881: 1864: 199: 81: 27: 1614:"Fast numerical computations with Cython" 1588: 1762:(Message to the electronic mailing-list 388:from Pyrex in 2007 by developers of the 1307: 1808: 1739:"Differences between Cython and Pyrex" 1429:Cython: A Guide for Python Programmers 48:Robert Bradshaw, Stefan Behnel, et al. 1793:from the original on 21 December 2021 1273:my_bugatti = Bugatti("Chiron", 2023) 7: 1561:Computing in Science and Engineering 276:that is typically used to generate 1787:"Cython: Past, Present and Future" 365:Low overhead in control structures 14: 2158:Software using the Apache license 1718:"Cython: C-Extensions for Python" 1557:"Cython: The Best of Both Worlds" 1536:. Technicaldiscovery.blogspot.com 1532:Oliphant, Travis (20 June 2011). 1269:Create an instance of the Bugatti 862:Using in IPython/Jupyter notebook 2011: 230: 112:3.0.0 beta 2 (27 March 2023 34: 337:and the ability to declare the 380:Cython is a derivative of the 1: 2148:Python (programming language) 1758:Ewing, Greg (21 March 2011). 1612:Seljebot, Dag Sverre (2009). 261:of the programming language 827:"Hello world app" 2179: 2163:Source-to-source compilers 2121:Python Software Foundation 1458:"FAQ · cython/cython Wiki" 763:# It is not compiled to C. 368:Low function call overhead 324:foreign function interface 15: 2110: 2009: 1639:: 495–512. Archived from 1277:Use the Bugatti's methods 282:wrapped in interface code 212: 132: 70: 33: 876: 855: 785: 754: 747:"Hello World!" 726: 414: 356:Optimistic optimizations 16:Not to be confused with 1637:Proceedings of MekIT'09 1315:Behnel, Stefan (2008). 137:Implementation language 114:; 17 months ago 1831:"Building Cython code" 687: 58:; 17 years ago 1835:cython.readthedocs.io 1581:10.1109/MCSE.2010.118 1512:cython.readthedocs.io 1384:cython.readthedocs.io 1361:, cython, 15 May 2023 720:Cython source file(s) 686:Hello World in Cython 685: 88:; 41 days ago 1426:Smith, Kurt (2015). 404:Cython files have a 319:Python interpreter. 25:Programming language 1573:2011CSE....13b..31B 710:file to invoke the 180:Filename extensions 53:First appeared 30: 1483:"Cython Changelog" 1335:"Release 3.0.11-1" 688: 401:to become Cython. 173:Apache License 2.0 2135: 2134: 2126:Python Conference 1646:on 4 January 2017 1443:978-1-4919-0155-7 1407:. Docs.cython.org 845:"*.pyx" 462:# Another C type 410:dynamically typed 274:compiled language 223: 222: 184:.pyx, .pxd, .pxi 56:28 July 2007 2170: 2102:Guido van Rossum 2015: 1990:Stackless Python 1914: 1905: 1898: 1891: 1882: 1868: 1863: 1862: 1860:Official website 1846: 1845: 1843: 1841: 1827: 1821: 1820: 1814: 1806: 1800: 1798: 1782: 1776: 1775: 1773: 1771: 1765: 1755: 1749: 1748: 1735: 1729: 1728: 1726: 1724: 1714: 1708: 1707: 1705: 1703: 1694:. Archived from 1688: 1682: 1681: 1679: 1677: 1668:. Archived from 1662: 1656: 1655: 1653: 1651: 1645: 1628: 1622: 1621: 1609: 1603: 1602: 1592: 1552: 1546: 1545: 1543: 1541: 1529: 1523: 1522: 1520: 1518: 1504: 1498: 1497: 1495: 1493: 1479: 1473: 1472: 1470: 1468: 1454: 1448: 1447: 1423: 1417: 1416: 1414: 1412: 1401: 1395: 1394: 1392: 1390: 1376: 1370: 1369: 1368: 1366: 1358:Cython Changelog 1353: 1347: 1346: 1344: 1342: 1331: 1325: 1324: 1312: 1237: 1234: 1231: 1228: 1225: 1222: 1219: 1216: 1213: 1210: 1207: 1204: 1201: 1198: 1195: 1192: 1189: 1186: 1183: 1180: 1177: 1174: 1171: 1168: 1165: 1162: 1159: 1156: 1153: 1150: 1147: 1144: 1141: 1138: 1135: 1132: 1129: 1126: 1123: 1120: 1117: 1114: 1111: 1108: 1105: 1102: 1099: 1096: 1093: 1090: 1087: 1084: 1081: 1078: 1075: 1072: 1069: 1066: 1063: 1060: 1057: 1054: 1051: 1048: 1045: 1042: 1039: 1036: 1033: 1030: 1027: 1024: 1021: 1018: 1015: 1012: 1009: 1006: 1003: 1000: 997: 994: 991: 988: 985: 982: 979: 976: 973: 970: 967: 964: 961: 958: 955: 952: 949: 946: 943: 940: 937: 934: 931: 928: 925: 922: 919: 916: 913: 910: 907: 904: 901: 898: 895: 892: 889: 886: 883: 880: 849: 846: 843: 840: 837: 834: 831: 828: 825: 822: 819: 816: 813: 810: 807: 804: 801: 798: 795: 792: 789: 782: 779: 776: 773: 770: 767: 764: 761: 758: 751: 748: 745: 742: 739: 736: 733: 730: 713: 709: 697: 673: 670: 667: 664: 661: 658: 655: 652: 649: 646: 643: 640: 637: 634: 631: 628: 625: 622: 619: 616: 613: 610: 607: 604: 601: 598: 595: 592: 589: 586: 583: 580: 577: 574: 571: 568: 565: 562: 559: 556: 553: 550: 547: 544: 541: 538: 535: 532: 529: 526: 523: 520: 517: 514: 511: 508: 505: 502: 499: 496: 493: 490: 487: 484: 481: 478: 475: 472: 469: 466: 463: 460: 457: 454: 451: 448: 445: 442: 439: 436: 433: 430: 427: 424: 421: 418: 407: 400: 352:Cython employs: 256: 255: 252: 251: 248: 245: 242: 239: 236: 203: 198: 195: 128: 122: 120: 115: 102: 96: 94: 89: 85: 66: 64: 59: 38: 31: 2178: 2177: 2173: 2172: 2171: 2169: 2168: 2167: 2138: 2137: 2136: 2131: 2106: 2088: 2067: 2016: 2007: 1995:Unladen Swallow 1922:Implementations 1916: 1912: 1909: 1858: 1857: 1854: 1849: 1839: 1837: 1829: 1828: 1824: 1807: 1796: 1794: 1784: 1783: 1779: 1769: 1767: 1763: 1757: 1756: 1752: 1737: 1736: 1732: 1722: 1720: 1716: 1715: 1711: 1701: 1699: 1698:on 3 March 2016 1690: 1689: 1685: 1675: 1673: 1672:on 4 April 2015 1664: 1663: 1659: 1649: 1647: 1643: 1630: 1629: 1625: 1611: 1610: 1606: 1554: 1553: 1549: 1539: 1537: 1531: 1530: 1526: 1516: 1514: 1506: 1505: 1501: 1491: 1489: 1481: 1480: 1476: 1466: 1464: 1456: 1455: 1451: 1444: 1425: 1424: 1420: 1410: 1408: 1403: 1402: 1398: 1388: 1386: 1378: 1377: 1373: 1364: 1362: 1355: 1354: 1350: 1340: 1338: 1337:. 5 August 2024 1333: 1332: 1328: 1314: 1313: 1309: 1305: 1288: 1266: 1263: 1260: 1257: 1253: 1249: 1244:class Bugatti: 1239: 1238: 1235: 1232: 1229: 1226: 1223: 1220: 1217: 1214: 1211: 1208: 1205: 1202: 1199: 1196: 1193: 1190: 1187: 1184: 1181: 1178: 1175: 1172: 1169: 1166: 1163: 1160: 1157: 1154: 1151: 1148: 1145: 1142: 1139: 1136: 1133: 1130: 1127: 1124: 1121: 1118: 1115: 1112: 1109: 1106: 1103: 1100: 1097: 1094: 1091: 1088: 1085: 1082: 1079: 1076: 1073: 1070: 1067: 1064: 1061: 1058: 1055: 1052: 1049: 1046: 1043: 1040: 1037: 1034: 1031: 1028: 1025: 1022: 1019: 1016: 1013: 1010: 1007: 1004: 1001: 998: 995: 992: 989: 986: 983: 980: 977: 974: 971: 968: 965: 962: 959: 956: 953: 950: 947: 944: 941: 938: 935: 932: 929: 926: 923: 920: 917: 914: 911: 908: 905: 902: 899: 896: 893: 890: 887: 884: 881: 878: 864: 859: 858: 851: 850: 847: 844: 841: 838: 835: 832: 829: 826: 823: 820: 817: 814: 811: 808: 805: 802: 799: 796: 793: 790: 787: 784: 783: 780: 777: 774: 771: 768: 765: 762: 759: 756: 753: 752: 749: 746: 743: 740: 737: 734: 731: 728: 711: 707: 695: 680: 675: 674: 671: 668: 665: 662: 659: 656: 653: 650: 647: 644: 641: 638: 635: 632: 629: 626: 623: 620: 617: 614: 611: 608: 605: 602: 599: 596: 593: 590: 587: 584: 581: 578: 575: 572: 569: 566: 563: 560: 557: 554: 551: 548: 545: 542: 539: 536: 533: 530: 527: 524: 521: 518: 515: 512: 509: 506: 503: 500: 497: 494: 491: 488: 485: 482: 479: 476: 474:# A Python type 473: 470: 467: 464: 461: 458: 455: 452: 449: 446: 443: 440: 437: 434: 431: 428: 425: 422: 419: 416: 405: 398: 378: 347:virtual machine 312: 233: 229: 192: 124: 118: 116: 113: 108:Preview release 98: 92: 90: 87: 62: 60: 57: 26: 21: 12: 11: 5: 2176: 2174: 2166: 2165: 2160: 2155: 2150: 2140: 2139: 2133: 2132: 2130: 2129: 2123: 2118: 2111: 2108: 2107: 2105: 2104: 2098: 2096: 2090: 2089: 2087: 2086: 2081: 2075: 2073: 2069: 2068: 2066: 2065: 2057: 2052: 2047: 2042: 2037: 2032: 2026: 2024: 2018: 2017: 2010: 2008: 2006: 2005: 1997: 1992: 1987: 1982: 1980:Python for S60 1977: 1972: 1967: 1962: 1957: 1952: 1947: 1942: 1937: 1932: 1926: 1924: 1918: 1917: 1910: 1908: 1907: 1900: 1893: 1885: 1879: 1878: 1869: 1853: 1852:External links 1850: 1848: 1847: 1822: 1777: 1750: 1730: 1709: 1683: 1657: 1623: 1604: 1547: 1524: 1499: 1474: 1449: 1442: 1434:O'Reilly Media 1418: 1396: 1371: 1348: 1326: 1306: 1304: 1301: 1300: 1299: 1294: 1287: 1284: 1279: 1278: 1271: 1270: 1264: 1261: 1258: 1254: 1250: 1246: 877: 863: 860: 856: 786: 755: 727: 722: 721: 718: 715: 679: 676: 415: 382:Pyrex language 377: 374: 370: 369: 366: 363: 360:Type inference 357: 311: 308: 221: 220: 210: 209: 205: 204: 190: 186: 185: 182: 176: 175: 170: 164: 163: 150: 144: 143: 138: 134: 133: 130: 129: 110: 104: 103: 86:(5 August 2024 80:3.0.11-1  78: 76:Stable release 72: 71: 68: 67: 54: 50: 49: 46: 40: 39: 24: 13: 10: 9: 6: 4: 3: 2: 2175: 2164: 2161: 2159: 2156: 2154: 2151: 2149: 2146: 2145: 2143: 2127: 2124: 2122: 2119: 2116: 2113: 2112: 2109: 2103: 2100: 2099: 2097: 2095: 2091: 2085: 2082: 2080: 2077: 2076: 2074: 2070: 2064: 2062: 2058: 2056: 2053: 2051: 2048: 2046: 2043: 2041: 2038: 2036: 2033: 2031: 2028: 2027: 2025: 2023: 2019: 2014: 2004: 2002: 1998: 1996: 1993: 1991: 1988: 1986: 1983: 1981: 1978: 1976: 1973: 1971: 1968: 1966: 1963: 1961: 1958: 1956: 1953: 1951: 1948: 1946: 1943: 1941: 1938: 1936: 1933: 1931: 1930:CircuitPython 1928: 1927: 1925: 1923: 1919: 1915: 1906: 1901: 1899: 1894: 1892: 1887: 1886: 1883: 1877: 1873: 1870: 1867: 1861: 1856: 1855: 1851: 1836: 1832: 1826: 1823: 1818: 1812: 1804: 1792: 1788: 1781: 1778: 1761: 1754: 1751: 1746: 1745: 1740: 1734: 1731: 1719: 1713: 1710: 1697: 1693: 1687: 1684: 1671: 1667: 1661: 1658: 1642: 1638: 1634: 1627: 1624: 1619: 1615: 1608: 1605: 1600: 1596: 1591: 1586: 1582: 1578: 1574: 1570: 1566: 1562: 1558: 1551: 1548: 1535: 1528: 1525: 1513: 1509: 1503: 1500: 1488: 1484: 1478: 1475: 1463: 1459: 1453: 1450: 1445: 1439: 1435: 1431: 1430: 1422: 1419: 1406: 1400: 1397: 1385: 1381: 1375: 1372: 1360: 1359: 1352: 1349: 1336: 1330: 1327: 1322: 1318: 1311: 1308: 1302: 1298: 1295: 1293: 1290: 1289: 1285: 1283: 1276: 1275: 1274: 1268: 1267: 1245: 1242: 875: 873: 869: 861: 854: 725: 719: 716: 705: 704: 703: 701: 693: 684: 677: 413: 411: 402: 396: 391: 387: 383: 375: 373: 367: 364: 361: 358: 355: 354: 353: 350: 348: 342: 340: 336: 333: 329: 326:for invoking 325: 322:Cython has a 320: 316: 309: 307: 304: 302: 298: 294: 289: 287: 283: 279: 275: 270: 268: 264: 260: 254: 227: 219: 215: 211: 208:Influenced by 206: 202: 197: 191: 187: 183: 181: 177: 174: 171: 169: 165: 162: 158: 154: 151: 149: 145: 142: 139: 135: 131: 127: 111: 109: 105: 101: 93:5 August 2024 84: 79: 77: 73: 69: 55: 51: 47: 45: 41: 37: 32: 23: 19: 2059: 1999: 1944: 1838:. Retrieved 1834: 1825: 1801:– via 1795:. Retrieved 1780: 1768:. Retrieved 1753: 1742: 1733: 1721:. Retrieved 1712: 1700:. Retrieved 1696:the original 1686: 1674:. Retrieved 1670:the original 1660: 1648:. Retrieved 1641:the original 1636: 1626: 1617: 1607: 1567:(2): 31–39. 1564: 1560: 1550: 1538:. Retrieved 1527: 1515:. Retrieved 1511: 1502: 1490:. Retrieved 1486: 1477: 1465:. Retrieved 1461: 1452: 1428: 1421: 1409:. Retrieved 1399: 1387:. Retrieved 1383: 1374: 1363:, retrieved 1357: 1351: 1339:. Retrieved 1329: 1320: 1310: 1280: 1272: 1243: 1240: 865: 852: 806:Cython.Build 723: 689: 403: 379: 371: 351: 343: 321: 317: 313: 305: 290: 272:Cython is a 271: 225: 224: 22: 1950:MicroPython 1723:22 November 1590:11336/13103 1517:11 December 1389:9 September 833:ext_modules 692:hello world 399:cython-lxml 339:static type 126:[±] 100:[±] 2142:Categories 1960:IronPython 1764:python-dev 1487:cython.org 1467:11 January 1321:EuroPython 1303:References 794:setuptools 712:setuptools 696:setuptools 362:(optional) 119:2023-03-27 63:2007-07-28 2040:Ninja-IDE 1985:Shed Skin 1341:22 August 839:cythonize 812:cythonize 778:say_hello 735:say_hello 698:or other 690:A sample 44:Developer 2115:Software 2094:Designer 1935:CLPython 1840:24 April 1811:cite web 1791:Archived 1620:: 15–22. 1599:14292107 1286:See also 888:load_ext 872:notebook 708:setup.py 335:routines 286:run time 259:superset 2128:(PyCon) 2045:PyCharm 1940:CPython 1803:YouTube 1650:14 June 1569:Bibcode 1540:21 July 1492:21 July 1411:21 July 1197:1000000 1140:1000000 868:IPython 678:Example 376:History 293:Windows 278:CPython 257:) is a 189:Website 168:License 153:Windows 117: ( 91: ( 61: ( 18:CPython 2117:(list) 2072:Topics 2055:Spyder 1965:Jython 1945:Cython 1913:Python 1876:GitHub 1872:Cython 1744:GitHub 1702:28 May 1676:28 May 1597:  1462:GitHub 1440:  1365:19 May 1188:timeit 1131:timeit 1110:return 990:return 903:cython 891:Cython 809:import 797:import 766:import 700:PEP517 672:result 669:return 642:append 636:result 477:result 423:primes 386:forked 310:Design 299:, and 263:Python 226:Cython 218:Python 194:cython 141:Python 123:) 97:) 29:Cython 2050:PyDev 1970:Psyco 1955:Numba 1797:5 May 1770:5 May 1644:(PDF) 1595:S2CID 1297:Numba 1206:loops 1149:loops 1077:range 1008:cpdef 957:range 815:setup 800:setup 772:hello 769:hello 741:print 549:while 525:while 301:Linux 297:macOS 161:Linux 157:macOS 2084:ASGI 2079:WSGI 2061:more 2035:IDLE 2030:eric 2022:IDEs 2001:more 1975:PyPy 1842:2017 1817:link 1799:2011 1772:2011 1725:2015 1704:2010 1678:2010 1652:2011 1542:2013 1519:2020 1494:2023 1469:2023 1438:ISBN 1413:2013 1391:2021 1367:2023 1343:2024 1292:PyPy 1236:loop 1212:best 1203:1000 1176:loop 1167:26.5 1155:best 1053:cdef 1035:long 1032:cdef 821:name 803:from 791:from 555:< 534:kmax 531:< 504:1000 498:kmax 492:1000 489:> 486:kmax 465:cdef 441:cdef 432:kmax 406:.pyx 390:Sage 196:.org 2063:... 2003:... 1874:on 1585:hdl 1577:doi 1233:per 1224:279 1173:per 1116:... 1104:... 1089:... 1068:for 1062:... 1056:int 1047:... 1026:... 1017:int 1002:... 996:... 984:... 969:... 948:for 942:... 927:... 912:def 906:... 874:): 738:(): 732:def 561:and 468:int 444:int 429:int 420:def 395:XML 332:C++ 2144:: 1833:. 1813:}} 1809:{{ 1789:. 1741:. 1635:. 1616:. 1593:. 1583:. 1575:. 1565:13 1563:. 1559:. 1510:. 1485:. 1460:. 1436:. 1432:. 1382:. 1319:. 1215:of 1179:In 1170:ms 1158:of 1146:10 1122:In 1098:+= 1086:): 1074:in 1023:): 978:+= 966:): 954:in 924:): 900:%% 894:In 879:In 848:)) 781:() 706:A 603:== 597:if 573:!= 483:if 435:): 295:, 269:. 241:aɪ 216:, 159:, 155:, 148:OS 1904:e 1897:t 1890:v 1844:. 1819:) 1805:. 1774:. 1766:) 1747:. 1727:. 1706:. 1680:. 1654:. 1601:. 1587:: 1579:: 1571:: 1544:. 1521:. 1496:. 1471:. 1446:. 1415:. 1393:. 1345:. 1230:s 1227:µ 1221:: 1218:3 1209:, 1200:) 1194:( 1191:g 1185:% 1182:: 1164:: 1161:3 1152:, 1143:) 1137:( 1134:f 1128:% 1125:: 1119:: 1113:a 1107:: 1101:i 1095:a 1092:: 1083:n 1080:( 1071:i 1065:: 1059:i 1050:: 1044:0 1041:= 1038:a 1029:: 1020:n 1014:( 1011:g 1005:: 999:: 993:a 987:: 981:i 975:a 972:: 963:n 960:( 951:i 945:: 939:0 936:= 933:a 930:: 921:n 918:( 915:f 909:: 897:: 885:% 882:: 842:( 836:= 830:, 824:= 818:( 775:. 750:) 744:( 666:1 663:+ 660:n 657:= 654:n 651:) 648:n 645:( 639:. 633:1 630:+ 627:k 624:= 621:k 618:n 615:= 612:p 609:: 606:k 600:i 594:1 591:+ 588:i 585:= 582:i 579:: 576:0 570:p 567:% 564:n 558:k 552:i 546:0 543:= 540:i 537:: 528:k 522:2 519:= 516:n 513:0 510:= 507:k 501:= 495:: 480:= 471:p 459:i 456:, 453:k 450:, 447:n 426:( 330:/ 328:C 267:C 253:/ 250:n 247:ɒ 244:θ 238:s 235:ˈ 232:/ 228:( 214:C 121:) 95:) 65:) 20:.

Index

CPython

Developer
Stable release
Edit this on Wikidata
[±]
Preview release
[±]
Python
OS
Windows
macOS
Linux
License
Apache License 2.0
Filename extensions
cython.org
Edit this at Wikidata
C
Python
/ˈsθɒn/
superset
Python
C
compiled language
CPython
wrapped in interface code
run time
Windows
macOS

Text is available under the Creative Commons Attribution-ShareAlike License. Additional terms may apply.