Skip to content

Docs: replace an esoteric Von Neumann mention #137598

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions Doc/reference/datamodel.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@ Objects, values and types
single: data

:dfn:`Objects` are Python's abstraction for data. All data in a Python program
is represented by objects or by relations between objects. (In a sense, and in
conformance to Von Neumann's model of a "stored program computer", code is also
represented by objects.)
is represented by objects or by relations between objects. Even code is
represented by objects.
Comment on lines +19 to +20
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code isn't represented by objects: the compiled bytecode, or the abstract tree, or the tokens are though. The previous sentence has "In a sense ... code is also represented by objects", which (by hedging) seems more accurate?

If the Von Neumann aside is to go, perhaps it makes more sense to bin the full sentence?:

Suggested change
is represented by objects or by relations between objects. Even code is
represented by objects.
is represented by objects or by relations between objects.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd say for the first paragraph it's good enough to say code is represented by objects. It carries the point of the original sentence, to underscore how pervasive objects are in the Python world.


.. index::
pair: built-in function; id
Expand All @@ -29,9 +28,6 @@ represented by objects.)
single: mutable object
single: immutable object

.. XXX it *is* now possible in some cases to change an object's
type, under certain controlled conditions
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed this comment since it is now an actual footnote.

Every object has an identity, a type and a value. An object's *identity* never
changes once it has been created; you may think of it as the object's address in
memory. The :keyword:`is` operator compares the identity of two objects; the
Expand Down
5 changes: 2 additions & 3 deletions Lib/pydoc_data/topics.py
Original file line number Diff line number Diff line change
Expand Up @@ -6894,9 +6894,8 @@ class that has an "__rsub__()" method, "type(y).__rsub__(y, x)" is
*************************

*Objects* are Python’s abstraction for data. All data in a Python
program is represented by objects or by relations between objects. (In
a sense, and in conformance to Von Neumann’s model of a “stored
program computer”, code is also represented by objects.)
program is represented by objects or by relations between objects.
Even code is represented by objects.

Every object has an identity, a type and a value. An object’s
*identity* never changes once it has been created; you may think of it
Expand Down
Loading