Visitar URL original
gh-99908 Update 'odds and ends' `class` documentation by JosephSBoyle · Pull Request #100498 · python/cpython · GitHub
Skip to content
Closed
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
Prev Previous commit
Use interpreter output, not comments, like with Dog example
  • Loading branch information
hauntsaninja authored and JosephSBoyle committed Dec 24, 2022
commit 3021b7c29bd6b613eb23446a43bfedf37fa36a86
4 changes: 2 additions & 2 deletions Doc/tutorial/classes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -752,9 +752,9 @@ is to use :mod:`dataclasses` for this purpose::
john = Employee("john", "computer lab", 1000)

>>> john.dept
# "computer lab"
"computer lab"
>>> john.salary
# '1000'
1000

A piece of Python code that expects a particular abstract data type can often be
passed a class that emulates the methods of that data type instead. For
Expand Down