Skip to content

Commit 87196da

Browse files
committed
Merge main into PR 125229; address review feedback on hash() docstring
Merges current upstream main into the branch (the PR had gone stale since Oct 2024) and rewords the hash() builtin docstring to incorporate review comments from @JelleZijlstra, @ncoghlan, @nedbat, and others: - Drop "within this process" from the first sentence (Jelle, ncoghlan): the process caveat is still stated plainly in the body, so the first-line qualifier is redundant. - Drop the "dict and set hash tables" sentence (Jelle, ncoghlan): implementation details of built-in containers don't belong in the user- facing docstring for hash(). - Add the "Not all objects are hashable; ... raises TypeError" note (Jelle's suggestion, phrasing informed by ncoghlan's rewrite). - Keep the original "equal => same hash, but not the reverse" formulation, which is what the Python data model documents. - Do not add a cryptographic warning (sobolevn raised the question but also flagged that such warnings can encourage misuse). https://claude.ai/code/session_01UumhMLqHB8fqUuNWsC8RCe
2 parents 027cc3a + 1dfe99a commit 87196da

File tree

3,838 files changed

+596170
-201719
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

3,838 files changed

+596170
-201719
lines changed

.azure-pipelines/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
trigger: ['main', '3.13', '3.12', '3.11', '3.10', '3.9', '3.8']
1+
trigger: ['main', '3.*']
22

33
jobs:
44
- job: Prebuild
55
displayName: Pre-build checks
66

77
pool:
8-
vmImage: ubuntu-22.04
8+
vmImage: ubuntu-24.04
99

1010
steps:
1111
- template: ./prebuild-checks.yml

.devcontainer/devcontainer.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
{
2-
"image": "ghcr.io/python/devcontainer:2024.09.25.11038928730",
2+
"image": "ghcr.io/python/devcontainer:latest",
33
"onCreateCommand": [
44
// Install common tooling.
55
"dnf",
66
"install",
77
"-y",
8-
"which",
9-
"zsh",
10-
"fish",
118
// For umask fix below.
129
"/usr/bin/setfacl"
1310
],
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
{
2+
"image": "ghcr.io/python/wasicontainer:latest",
3+
"onCreateCommand": [
4+
// Install common tooling.
5+
"dnf",
6+
"install",
7+
"-y",
8+
// For umask fix below.
9+
"/usr/bin/setfacl"
10+
],
11+
"updateContentCommand": {
12+
// Using the shell for `nproc` usage.
13+
"python": "python3 Tools/wasm/wasi build --quiet -- --with-pydebug -C"
14+
},
15+
"postCreateCommand": {
16+
// https://github.com/orgs/community/discussions/26026
17+
"umask fix: workspace": ["sudo", "setfacl", "-bnR", "."],
18+
"umask fix: /tmp": ["sudo", "setfacl", "-bnR", "/tmp"]
19+
},
20+
"customizations": {
21+
"vscode": {
22+
"extensions": [
23+
// Highlighting for Parser/Python.asdl.
24+
"brettcannon.zephyr-asdl",
25+
// Highlighting for configure.ac.
26+
"maelvalais.autoconf",
27+
// C auto-complete.
28+
"ms-vscode.cpptools",
29+
// Python auto-complete.
30+
"ms-python.python"
31+
],
32+
"settings": {
33+
"C_Cpp.default.compilerPath": "/usr/bin/clang",
34+
"C_Cpp.default.cStandard": "c11",
35+
"C_Cpp.default.defines": [
36+
"CONFIG_64",
37+
"Py_BUILD_CORE"
38+
],
39+
"C_Cpp.default.includePath": [
40+
"${workspaceFolder}/*",
41+
"${workspaceFolder}/Include/**"
42+
],
43+
// https://github.com/microsoft/vscode-cpptools/issues/10732
44+
"C_Cpp.errorSquiggles": "disabled",
45+
"editor.insertSpaces": true,
46+
"editor.rulers": [
47+
80
48+
],
49+
"editor.tabSize": 4,
50+
"editor.trimAutoWhitespace": true,
51+
"files.associations": {
52+
"*.h": "c"
53+
},
54+
"files.encoding": "utf8",
55+
"files.eol": "\n",
56+
"files.insertFinalNewline": true,
57+
"files.trimTrailingWhitespace": true,
58+
"python.analysis.diagnosticSeverityOverrides": {
59+
// Complains about shadowing the stdlib w/ the stdlib.
60+
"reportShadowedImports": "none",
61+
// Doesn't like _frozen_importlib.
62+
"reportMissingImports": "none"
63+
},
64+
"python.analysis.extraPaths": [
65+
"Lib"
66+
],
67+
"[restructuredtext]": {
68+
"editor.tabSize": 3
69+
}
70+
}
71+
}
72+
}
73+
}

.editorconfig

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
root = true
22

3-
[*.{py,c,cpp,h,js,rst,md,yml}]
3+
[*.{py,c,cpp,h,js,rst,md,yml,yaml,gram}]
44
trim_trailing_whitespace = true
55
insert_final_newline = true
66
indent_style = space
77

8-
[*.{py,c,cpp,h}]
8+
[*.{py,c,cpp,h,gram}]
99
indent_size = 4
1010

1111
[*.rst]
1212
indent_size = 3
1313

14-
[*.{js,yml}]
14+
[*.{js,yml,yaml}]
1515
indent_size = 2

.gitattributes

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
*.ico binary
1111
*.jpg binary
1212
*.pck binary
13+
*.pdf binary
1314
*.png binary
1415
*.psd binary
1516
*.tar binary
@@ -67,6 +68,8 @@ PCbuild/readme.txt dos
6768
**/clinic/*.cpp.h generated
6869
**/clinic/*.h.h generated
6970
*_db.h generated
71+
Doc/_static/tachyon-example-*.html generated
72+
Doc/c-api/lifecycle.dot.svg generated
7073
Doc/data/stable_abi.dat generated
7174
Doc/library/token-list.inc generated
7275
Include/internal/pycore_ast.h generated
@@ -80,13 +83,19 @@ Include/opcode.h generated
8083
Include/opcode_ids.h generated
8184
Include/token.h generated
8285
Lib/_opcode_metadata.py generated
86+
Lib/idlelib/help.html generated
8387
Lib/keyword.py generated
88+
Lib/pydoc_data/topics.py generated
89+
Lib/pydoc_data/module_docs.py generated
8490
Lib/test/certdata/*.pem generated
8591
Lib/test/certdata/*.0 generated
8692
Lib/test/levenshtein_examples.json generated
8793
Lib/test/test_stable_abi_ctypes.py generated
94+
Lib/test/test_zoneinfo/data/*.json generated
8895
Lib/token.py generated
8996
Misc/sbom.spdx.json generated
97+
Modules/_testinternalcapi/test_cases.c.h generated
98+
Modules/_testinternalcapi/test_targets.h generated
9099
Objects/typeslots.inc generated
91100
PC/python3dll.c generated
92101
Parser/parser.c generated
@@ -97,7 +106,9 @@ Python/executor_cases.c.h generated
97106
Python/generated_cases.c.h generated
98107
Python/optimizer_cases.c.h generated
99108
Python/opcode_targets.h generated
109+
Python/record_functions.c.h generated
100110
Python/stdlib_module_names.h generated
101111
Tools/peg_generator/pegen/grammar_parser.py generated
102112
aclocal.m4 generated
103113
configure generated
114+
*.min.js generated

0 commit comments

Comments
 (0)