-
-
Notifications
You must be signed in to change notification settings - Fork 32.6k
gh-77566: Clarify setdefault() behavior for dbm objects #137911
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
Conversation
Perhaps we could use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only methods which are not common for all mappings are documented. I do not think that it is worth to document setdefault()
.
On other hand, not all mapping methods are implemented, and not all missing methods are mentioned.
@@ -95,6 +95,10 @@ The object returned by :func:`~dbm.open` supports the same basic functionality a | |||
deleted, and the :keyword:`in` operator and the :meth:`!keys` method are | |||
available, as well as :meth:`!get` and :meth:`!setdefault` methods. | |||
|
|||
.. note:: | |||
Unlike the standard :class:`dict` type, the :meth:`dict.setdefault` method |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is self-contradictory. You need to refer to :meth:`!setdefault`
instead of :meth:`dict.setdefault`
.
Also, I suggest to refer to :term:`mapping`
instead of :class:`dict`
above.
@@ -204,6 +208,14 @@ or any other SQLite browser, including the SQLite CLI. | |||
|
|||
.. versionadded:: next | |||
|
|||
.. method:: sqlite3.setdefault(key, default) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No other methods are documented here, except reorganize()
. Even close()
is barely mentioned.
Many other documentation changes are needed. So I created other PR for them, and the |
See #137919. |
📚 Documentation preview 📚: https://cpython-previews--137911.org.readthedocs.build/