You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Documentation/differences-from-c-python.md
+27Lines changed: 27 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,6 +10,33 @@ This page documents various differences between IronPython and CPython. Since Ir
10
10
11
11
* Interaction with COM objects is handled by the CLR rather than a python library binding to the native COM dlls.
12
12
13
+
# Integers
14
+
15
+
*`int`/`long` are separate types instead of the unified `int` type used by CPython. _Tracked by [IronLanguages/ironpython3#52](https://github.com/IronLanguages/ironpython3/issues/52)._
16
+
17
+
The `long` type is no longer exposed in built-ins however it still shows up while getting the type of a long number.
18
+
19
+
_CPython_
20
+
```
21
+
>>> type(1<<64)
22
+
<class 'int'>
23
+
```
24
+
25
+
_IronPython_
26
+
```
27
+
>>> type(1<<64)
28
+
<class 'long'>
29
+
```
30
+
31
+
However, in order to reduce compatibility issues, using `isinstance` to test if a value is an integer will work as it does in CPython:
32
+
33
+
_CPython_ and _IronPython_
34
+
```
35
+
>>> isinstance(1<<64, int)
36
+
True
37
+
```
38
+
39
+
13
40
# Strings
14
41
15
42
*`str` objects are represented in UTF-16 (like all .NET strings) rather than UTF-32 used by CPython.
IronPython 3.4 uses Python 3.4 syntax and standard libraries and so your Python code will need to be updated accordingly. There are numerous tools and guides available on the web to help porting from Python 2 to 3.
4
+
5
+
## Binary Compatibility
6
+
7
+
The IronPython 3 binaries are not compatible with the IronPython 2 binaries. Modules compiled with `clr.CompileModules` using IronPython 2 are not compatible and will need to be recompiled using IronPython 3.
8
+
9
+
## Checking for IronPython
10
+
11
+
In an effort to improve compatibility, `sys.platform` no longer returns `cli`. If you wish to check if you're running on IronPython the recommended pattern is to check that `sys.implementation.name` is equal to `ironpython`:
Copy file name to clipboardExpand all lines: README.md
+19-5Lines changed: 19 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,11 +2,9 @@ IronPython 3
2
2
============
3
3
**There is still much that needs to be done to support Python 3.x. We are working on it, albeit slowly. We welcome all those who would like to help!**
4
4
5
-
The current target a Python 3.4 compatible release, although features and behaviors from later versions may be included.
6
-
7
5
[Official Website](http://ironpython.net)
8
6
9
-
IronPython is an open-source implementation of the Python programming language which is tightly integrated with the .NET Framework. IronPython can use the .NET Framework and Python libraries, and other .NET languages can use Python code just as easily.
7
+
IronPython is an open-source implementation of the Python programming language which is tightly integrated with .NET. IronPython can use .NET and Python libraries, and other .NET languages can use Python code just as easily.
10
8
11
9
|**What?**|**Where?**|
12
10
| --------: | :------------: |
@@ -42,14 +40,30 @@ IronPython 3 targets Python 3, including the re-organized standard library, Unic
42
40
This project has adopted the code of conduct defined by the Contributor Covenant to clarify expected behavior in our community.
43
41
For more information see the [.NET Foundation Code of Conduct](https://dotnetfoundation.org/code-of-conduct).
44
42
43
+
## State of the Project
44
+
The current target is Python 3.4, although features and behaviors from later versions may be included.
45
+
46
+
See the following lists for features from each version of CPython that have been implemented:
47
+
48
+
-[What's New In Python 3.0](WhatsNewInPython30.md)
49
+
-[What's New In Python 3.1](WhatsNewInPython31.md)
50
+
-[What's New In Python 3.2](WhatsNewInPython32.md)
51
+
-[What's New In Python 3.3](WhatsNewInPython33.md)
52
+
-[What's New In Python 3.4](WhatsNewInPython34.md)
53
+
54
+
## Upgrading from IronPython 2
55
+
For details on upgrading from IronPython 2 to 3 see the [Upgrading from IronPython 2 to 3](Documentation/upgrading-from-ipy2.md) article.
56
+
57
+
## Differences with CPython
58
+
While compatibility with CPython is one of our main goals with IronPython 3, there are still some differences that may cause issues. See [Differences from CPython](Documentation/differences-from-c-python.md) for details.
59
+
45
60
## Installation
46
61
Builds of IronPython 3 are not yet provided.
47
62
48
63
## Build
49
64
See the [building document](Documentation/building.md)
50
65
51
-
Since the main development is on Windows, Mono bugs may inadvertantly be introduced
52
-
- please report them!
66
+
Since the main development is on Windows, bugs on other platforms may inadvertently be introduced - please report them!
53
67
54
68
## Supported Platforms
55
69
IronPython 3 targets .NET Framework 4.6, .NET Core 2.1/3.1 and .NET 5.0. The support for .NET Core and .NET 5 will follow the lifecycle defined on [.NET Core and .NET 5 Support Policy](https://dotnet.microsoft.com/platform/support/policy/dotnet-core).
0 commit comments