Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
pypy.org
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
This instance will be upgraded to Heptapod 17.9.0rc1 on 2025-03-27 between 17:00 and 18:00 UTC+2
Show more breadcrumbs
PyPy
pypy.org
Commits
75e01653
Commit
75e01653
authored
15 years ago
by
Maciej Fijalkowski
Browse files
Options
Downloads
Patches
Plain Diff
use syntax highlightning
parent
1187dd9b
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
compat.html
+8
-20
8 additions, 20 deletions
compat.html
source/compat.txt
+12
-4
12 additions, 4 deletions
source/compat.txt
with
20 additions
and
24 deletions
compat.html
+
8
−
20
View file @
75e01653
...
...
@@ -75,21 +75,12 @@
<ul>
<li><p
class=
"first"
>
PyPy does not support refcounting semantics. The code below
won't fill the file immediately, but only after a certain period
of time, when the GC will collect:
</p>
<pre
class=
"literal-block"
>
open(
"
filename
"
,
"
w
"
).write(
"
stuff
"
)
</pre>
<p>
The proper fix is:
</p>
<pre
class=
"literal-block"
>
f = open(
"
filename
"
,
"
w
"
)
f.write(
"
stuff
"
)
f.close()
</pre>
<p>
or using the
<tt
class=
"docutils literal"
><span
class=
"pre"
>
with
</span></tt>
keyword:
</p>
<pre
class=
"literal-block"
>
with open(
"
filename
"
,
"
w
"
) as f:
f.write(
"
stuff
"
)
</pre>
of time, when the GC will collect
</p>
<div
class=
"syntax python"
><pre><span
class=
"nb"
>
open
</span><span
class=
"p"
>
(
</span><span
class=
"s"
>
"
filename
"
</span><span
class=
"p"
>
,
</span>
<span
class=
"s"
>
"
w
"
</span><span
class=
"p"
>
)
</span><span
class=
"o"
>
.
</span><span
class=
"n"
>
write
</span><span
class=
"p"
>
(
</span><span
class=
"s"
>
"
stuff
"
</span><span
class=
"p"
>
)
</span><br/></pre></div>
<p>
The proper fix is
</p>
<div
class=
"syntax python"
><pre><span
class=
"n"
>
f
</span>
<span
class=
"o"
>
=
</span>
<span
class=
"nb"
>
open
</span><span
class=
"p"
>
(
</span><span
class=
"s"
>
"
filename
"
</span><span
class=
"p"
>
,
</span>
<span
class=
"s"
>
"
w
"
</span><span
class=
"p"
>
)
</span><br/><span
class=
"n"
>
f
</span><span
class=
"o"
>
.
</span><span
class=
"n"
>
write
</span><span
class=
"p"
>
(
</span><span
class=
"s"
>
"
stuff
"
</span><span
class=
"p"
>
)
</span><br/><span
class=
"n"
>
f
</span><span
class=
"o"
>
.
</span><span
class=
"n"
>
close
</span><span
class=
"p"
>
()
</span><br/></pre></div>
<p>
or using the
<tt
class=
"docutils literal"
><span
class=
"pre"
>
with
</span></tt>
keyword
</p>
<div
class=
"syntax python"
><pre><span
class=
"k"
>
with
</span>
<span
class=
"nb"
>
open
</span><span
class=
"p"
>
(
</span><span
class=
"s"
>
"
filename
"
</span><span
class=
"p"
>
,
</span>
<span
class=
"s"
>
"
w
"
</span><span
class=
"p"
>
)
</span>
<span
class=
"k"
>
as
</span>
<span
class=
"n"
>
f
</span><span
class=
"p"
>
:
</span><br/>
<span
class=
"n"
>
f
</span><span
class=
"o"
>
.
</span><span
class=
"n"
>
write
</span><span
class=
"p"
>
(
</span><span
class=
"s"
>
"
stuff
"
</span><span
class=
"p"
>
)
</span><br/></pre></div>
</li>
<li><p
class=
"first"
>
We don't support certain attributes that were decided to be
implementation-dependent. For example,
<tt
class=
"docutils literal"
><span
class=
"pre"
>
gc.get_referrers
</span></tt>
does not exist.
...
...
@@ -99,11 +90,8 @@
</li>
<li><p
class=
"first"
>
You can't attach a
<tt
class=
"docutils literal"
><span
class=
"pre"
>
__del__
</span></tt>
method to a class after its creation.
</p>
</li>
<li><p
class=
"first"
>
You can't store non-string keys in type objects. Example:
</p>
<pre
class=
"literal-block"
>
class A(object):
locals()[42] = 3
</pre>
<li><p
class=
"first"
>
You can't store non-string keys in type objects. Example
</p>
<div
class=
"syntax python"
><pre><span
class=
"k"
>
class
</span>
<span
class=
"nc"
>
A
</span><span
class=
"p"
>
(
</span><span
class=
"nb"
>
object
</span><span
class=
"p"
>
):
</span><br/>
<span
class=
"nb"
>
locals
</span><span
class=
"p"
>
()[
</span><span
class=
"mi"
>
42
</span><span
class=
"p"
>
]
</span>
<span
class=
"o"
>
=
</span>
<span
class=
"mi"
>
3
</span><br/></pre></div>
<p>
won't work.
</p>
</li>
</ul>
...
...
This diff is collapsed.
Click to expand it.
source/compat.txt
+
12
−
4
View file @
75e01653
...
...
@@ -39,7 +39,9 @@
* PyPy does not support refcounting semantics. The code below
won't fill the file immediately, but only after a certain period
of time, when the GC will collect::
of time, when the GC will collect
.. syntax:: python
open("filename", "w").write("stuff")
...
...
@@ -43,9 +45,11 @@
open("filename", "w").write("stuff")
The proper fix is::
The proper fix is
.. syntax:: python
f = open("filename", "w")
f.write("stuff")
f.close()
...
...
@@ -47,9 +51,11 @@
f = open("filename", "w")
f.write("stuff")
f.close()
or using the ``with`` keyword::
or using the ``with`` keyword
.. syntax:: python
with open("filename", "w") as f:
f.write("stuff")
...
...
@@ -62,7 +68,9 @@
* You can't attach a ``__del__`` method to a class after its creation.
* You can't store non-string keys in type objects. Example::
* You can't store non-string keys in type objects. Example
.. syntax:: python
class A(object):
locals()[42] = 3
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment