Skip to content

Commit bffc150

Browse files
committed
Merge branch 'master' into 3.6
2 parents 858821d + 05f07f3 commit bffc150

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+36426
-1184
lines changed

Documentation/differences-from-c-python.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ $ source test.sh
132132
$ export NAME
133133
```
134134

135-
This creates an environment variable that is encoded using Latin-1 encoding, thather than the system encoding. CPython will escape the invalid byte 0xe9 (letter 'é' in Latin-1) in a lone surrogate 0xdce9, which is still an invalid Unicode character.
135+
This creates an environment variable that is encoded using Latin-1 encoding, rather than the system encoding. CPython will escape the invalid byte 0xe9 (letter 'é' in Latin-1) in a lone surrogate 0xdce9, which is still an invalid Unicode character.
136136

137137
_CPython_
138138
```
@@ -158,7 +158,7 @@ Andr�
158158
'0xfffd'
159159
```
160160

161-
The CPython's representation is not printable, but can be safely encoded back to the original form using `'surrogateescape'` (default when dealing with the OS environment):
161+
The CPython representation is not printable, but can be safely encoded back to the original form using `'surrogateescape'` (default when dealing with the OS environment):
162162

163163
_CPython_
164164
```
@@ -170,7 +170,7 @@ b'/bin:/usr/bin:/usr/local/bin:/home/Andr\xe9/bin'
170170
b'Andr\xe9'
171171
```
172172

173-
The IronPython's representation is printable, but the original byte value is lost:
173+
The IronPython representation is printable, but the original byte value is lost:
174174

175175
_IronPython_
176176
```
@@ -180,7 +180,7 @@ b'Andr\xef\xbf\xbd'
180180

181181
# Codecs
182182

183-
* Some single-byte codecs may have unused positions in their codepage. There are differences how CPython and IronPython (and .NET) handle such cases.
183+
* Some single-byte codecs may have unused positions in their codepage. There are differences between how CPython and IronPython (and .NET) handle such cases.
184184

185185
A simple example is encoding Windows-1252. According to the information on Microsoft's and the Unicode Consortium's websites, positions 81, 8D, 8F, 90, and 9D are unused; however, the Windows API `MultiByteToWideChar` maps these to the corresponding C1 control codes. The Unicode "best fit" mapping [documents this behavior](https://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WindowsBestFit/bestfit1252.txt). CPython will treat those bytes as invalid, while IronPython will map them to the "best fit" Unicode character:
186186

Documentation/getting-the-sources.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ The following links include resources for installing and using GIT:
1515

1616
### Creating a local GIT repository
1717

18-
You will first need to fork the IronPython3 project. [Creating a fork](https://help.github.com/fork-a-repo/) is recommended as it will allow you to contribute patches back easily. Click the "Fork" button on [https://github.com/IronLanguages/ironpython3/](https://github.com/IronLanguages/ironpython3/). This should create your personal fork, with a website like http://github.com/janedoe/ironpython3 (where janedoe is your github username).
18+
You will first need to fork the IronPython3 project. [Creating a fork](https://help.github.com/fork-a-repo/) is recommended as it will allow you to contribute patches back easily. Click the "Fork" button on [https://github.com/IronLanguages/ironpython3/](https://github.com/IronLanguages/ironpython3/). This should create your personal fork, with a web URL like http://github.com/janedoe/ironpython3 (where janedoe is your github username).
1919

2020
You can now use the git command-line client with many Linux distributions, Mac OS, Cygwin, and Windows (msysgit) to get the sources onto your local computer using the following commands:
2121

Documentation/installing.md

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Since .NET is a cross-platform framework, the instructions in this section apply
88

99
### .NET SDK
1010

11-
If the target system has already a full .NET SDK installed, the most straightforward method to install a standalone IronPython interpreter is by using [`dotnet tool`](https://learn.microsoft.com/en-us/dotnet/core/tools/global-tools).
11+
If the target system already has a full .NET SDK installed, the most straightforward method to install a standalone IronPython interpreter is by using [`dotnet tool`](https://learn.microsoft.com/en-us/dotnet/core/tools/global-tools).
1212

1313
#### _Global Tool_
1414

@@ -18,7 +18,7 @@ If the target system has already a full .NET SDK installed, the most straightfor
1818
dotnet tool install --global ironpython.console
1919
```
2020

21-
The switch `--global` can be abbreviated to `-g`. The `ipy` program will be installed in `~/.dotnet/tools`, together with the Python Standard Library for IronPython. The directory `~/.dotnet/tools` should have been added to the search path for the user (a.k.a. `PATH` environment variable), if not yet done.
21+
The switch `--global` can be abbreviated to `-g`. The `ipy` program will be installed in `~/.dotnet/tools`, together with the Python Standard Library for IronPython. The directory `~/.dotnet/tools` should be added to the search path for the user (AKA `PATH` environment variable), if not yet done.
2222

2323
Note that any additional Python packages installed using `ipy -m pip` from this location will be installed inside that directory, hence being "global" for the user.
2424

@@ -125,12 +125,26 @@ dpkg -i ~/Downloads/ironpython_3.X.Y.deb
125125

126126
On macOS (AKA OSX, Darwin), Mono provides the necessary .NET Framework. First install Mono following installation instructions from the [Mono Project page](https://www.mono-project.com/download/stable/#download-mac). After installation, verify that command `mono` is available at the shell prompt, with, e.g. `mono --version`.
127127

128-
Then download the `.pkg` installer from the project's [release page](https://github.com/IronLanguages/ironpython3/releases/latest) and execute it.
128+
Then download the `.pkg` installer from the project's [release page](https://github.com/IronLanguages/ironpython3/releases/latest) and execute it. The IronPython installation is placed in `/Library/Frameworks/IronPython.framework/Versions/3.X.Y` (`X` and `Y` being the minor and patch version numbers). It can be run with:
129129

130+
```
131+
mono /Library/Frameworks/IronPython.framework/Versions/3.X.Y/bin/ipy.exe
132+
```
133+
134+
Note that Mono comes with its own (old, obsolete, and unsupported) version of IronPython and a launcher script `ipy` in Mono's commands directory (`/Library/Frameworks/Mono.framework/Versions/Current/Commands/ipy`). Since Mono's command directory is by default added to the command search path, simply running `ipy` from the command line will most likely pick up the Mono version. This version reports version number 3.0.0.0 and is backed by Python StdLib 2.7. To verify if this is the case, run:
135+
136+
```shell
137+
$ which ipy
138+
/Library/Frameworks/Mono.framework/Versions/Current/Commands/ipy
139+
$ ipy -V
140+
IronPython 3.0 3.0.0.0 on 6.12.0.188 (2020-02/ca8abcb6bc4 Thu Oct 13 14:26:22 EDT 2022)
141+
```
142+
143+
It is recommended to create one's own launcher script launching the newer IronPython version and to put it before Mono's `ipy` on the search path.
130144

131145
# Installing Non-Released Versions
132146

133-
After a release, the development of IronPython continues so it is possible that a bug or a feature that is important to you got handled after the latest release. As each commit to the main project branch creates precompiled artifacts, it is still possible to install the relevant (or latest development) version of IronPython without the need to compile the whole project from scratch.
147+
After a release, the development of IronPython continues so it is possible that a bug or a feature that is important to you was handled after the latest release. As each commit to the main project branch creates precompiled artifacts, it is still possible to install the relevant (or latest development) version of IronPython without the need to compile the whole project from scratch.
134148

135149
Go to the project's [_Actions_ page](https://github.com/IronLanguages/ironpython3/actions) and find the commit you are interested in. Or simply find the topmost commit to `master` that has all tests passing. The _Status_ and _Branch_ filters in the top bar are helpful to narrow the list down. Then click on the commit hyperlink to access the CI run summary. At the bottom of that page there is artifact `packages`, which contains all binary artifacts the project produces. Download it and unzip. Choose the right package for your needs and follow instructions above for the officially released artifacts. For convenience, here is a table with usable packages:
136150

Documentation/modifying-the-sources.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Most PR's will not be accepted if there is not a test included.
1414
* Use `/*!*/` for method parameters and instance fields that should never be null. [Spec# annotations](http://research.microsoft.com/specsharp).
1515
* Do not use public fields (Base::algorithm, buffer). Use properties if it is necessary to expose the field or private/internal visibility otherwise.
1616
* Use `readonly` if the field is not mutated after the object is constructed.
17-
* Auto properties are to be used when possible instead of private fields with wrapping properties
17+
* Auto properties are to be used when possible instead of private fields with wrapping properties.
1818
* String interpolation should use used instead of calls to `String.Format`
1919

2020
# Validating the changes

Documentation/upgrading-from-ipy2.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,11 @@ The creation of either `Int32` or `BigInteger` instances happens automatically b
104104
False
105105
```
106106

107-
In the opposite direction, if it is essential to create `Int32` objects, either use constructors for `int` or `Int32`. In the current implementation, the former converts an integer to `Int32` if the value fits in 32 bits, otherwise it leaves it as `BigInteger`. The latter throws an exception is the conversion is not possible. Although the behavior of the constructor `int` may or may not change in the future, it is always guaranteed to convert the value to the "canonical form" adopted for that version of IronPython.
107+
In the opposite direction, if it is essential to create `Int32` objects, either use constructors for `int` or `Int32`. In the current implementation, the former converts an integer to `Int32` if the value fits in 32 bits, otherwise it leaves it as `BigInteger`. The latter throws an exception if the conversion is not possible. Although the behavior of the constructor `int` may or may not change in the future, it is always guaranteed to convert the value to the "canonical form" adopted for that version of IronPython.
108108

109109
```pycon
110110
>>> # k is a BigInteger that fits in 32 bits
111-
>>> isinstance(j, System.Int32)
111+
>>> isinstance(k, System.Int32)
112112
False
113113
>>> hex(k)
114114
'0x7fffffff'
@@ -150,7 +150,7 @@ When an `int` object is serialized using `pickle.dump(x, myfile)` and subsequent
150150

151151
### BigIntegerV2 API
152152

153-
In IronPython 2, `long` type carries an obsolete `BigIntegerV2` API, accessible after importing `System`. In IronPython 3 this API is not available directly on `int` instances (regardless whether the instance is `Int32` or `BigInteger`), but is still accessible in some form through `Microsoft.Scripting.Utils.MathUtils` in `Microsoft.Dynamic.dll`.
153+
In IronPython 2, `long` type carries an obsolete `BigIntegerV2` API, accessible after importing `System`. In IronPython 3 this API is not available directly on `int` instances (regardless of whether the instance is `Int32` or `BigInteger`), but is still accessible in some form through `Microsoft.Scripting.Utils.MathUtils` in `Microsoft.Dynamic.dll`.
154154

155155
```pycon
156156
>>> # IronPython 2

0 commit comments

Comments
 (0)