You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Missleading example of value validation for dbm since 3.13 #131323
On 3.13+ indeed the assignment db['www.yahoo.com'] = 4 does not throw error. The value is assigned and stored as a bytes object.
The docs could be changed to something like "... can raise an exception, depending on the backend ...". But I am a little surprised the difference in backends is there in the first place. The documentation at https://docs.python.org/3/library/dbm.html states the keys and values are stored as bytes, but not which kind of objects can be assigned.
Activity
eendebakpt commentedon Mar 17, 2025
On 3.13+ indeed the assignment
db['www.yahoo.com'] = 4does not throw error. The value is assigned and stored as abytesobject.The docs could be changed to something like "... can raise an exception, depending on the backend ...". But I am a little surprised the difference in backends is there in the first place. The documentation at https://docs.python.org/3/library/dbm.html states the keys and values are stored as
bytes, but not which kind of objects can be assigned.@erlend-aasland
Merge branch 'main' into pythongh-131323
tpoliaw commentedon Oct 1, 2025
Would it make more sense to make the behaviour consistent than to have 'if x, then the behaviour is y else z' in the docs?
Merge branch 'main' into pythongh-131323
Merge branch 'pythongh-131323' of github.com:furkanonder/cpython into p…
Merge branch 'main' into pythongh-131323
Merge branch 'main' into pythongh-131323
Merge branch 'main' into pythongh-131323
Merge branch 'main' into pythongh-131323