| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:8117b8e8-75d3-b678-6959-fc54a4fd2b0b |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | A1BA:1ED25A:96D7:D332:6B005FF3 |
| html-safe-nonce | aee8de76466866dbdc4a6356ba9788cda26a96312eb0e892ba5417cbd2feb05a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMUJBOjFFRDI1QTo5NkQ3OkQzMzI6NkIwMDVGRjMiLCJ2aXNpdG9yX2lkIjoiNzQ1NTA0NDMwNjc4OTc1MjgxOSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 6c57c7e0208e42132e828c68494cf7355baa8db6e8143f66f0e0cc3610a856e2 |
| hovercard-subject-tag | pull_request:1538178409 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | ///pull_requests/show/files |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/python/cpython/pull/110223/files |
| twitter:image | https://avatars.githubusercontent.com/u/16078332?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/16078332?s=400&v=4 |
| og:image:alt | Resolves #110222
The implementation in this PR is roughly equivalent to:
class SomeStructSeq:
def __replace__(self, /, **kwargs):
if self.n_unamed_fields > 0:
raise TypeE... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 29be975efff6507a5d135de9c7d634cf7ff8f0c55222a64386ab3202209aaf73 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | eacd927ba6112e3b01ba99c762bd699a4a4f5df7 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| Skip to content | https://github.com/python/cpython/pull/110223/files#start-of-content |
| https://github.com/ |
| Sign in | https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F110223%2Ffiles |
| GitHubRepository hosting, code review, and collaboration | https://github.com/platform |
| CopilotAI coding agent for tasks, projects, and automated work | https://github.com/features/copilot |
| ActionsCI/CD and automation | https://github.com/features/actions |
| Code QualityQuality analysis, fixes, and enforcement | https://github.com/features/code-quality |
| CodespacesCloud development environments | https://github.com/features/codespaces |
| Code SecurityVulnerability detection and remediation | https://github.com/security/advanced-security/code-security |
| Secret ProtectionSecret scanning and leak prevention | https://github.com/security/advanced-security/secret-protection |
| All Features | https://github.com/features |
| Documentation | https://docs.github.com/en |
| Training | https://learn.github.com/skills |
| Certifications | https://learn.github.com/credentials |
| Build with Copilot | https://github.com/features/ai |
| Customize Copilot | https://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview |
| Integrations | https://github.com/marketplace |
| Trending repos | https://github.com/trending |
| GitHub Sponsors | https://github.com/open-source/sponsors |
| Developer articles | https://github.com/resources/articles |
| ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place. | https://github.blog/changelog/ |
| Enterprises | https://github.com/enterprise |
| Team | https://github.com/team |
| Startups | https://github.com/enterprise/startups |
| Nonprofits | https://github.com/solutions/industry/nonprofits |
| Healthcare | https://github.com/solutions/industry/healthcare |
| Financial services | https://github.com/solutions/industry/financial-services |
| Manufacturing | https://github.com/solutions/industry/manufacturing |
| Government | https://github.com/solutions/industry/government |
| See all industries | https://github.com/solutions/industry |
| Why GitHub | https://github.com/why-github |
| Customer Stories | https://github.com/customer-stories |
| Business insights | https://github.com/solutions/executive-insights |
| Trust Center | https://github.com/trust-center |
| GitHub Advanced SecurityEnterprise-grade code security | https://github.com/security/advanced-security |
| Copilot for businessEnterprise-grade AI features | https://github.com/features/copilot/copilot-business |
| Premium SupportEnterprise-grade 24/7 support | https://github.com/enterprise/premium-support |
| Documentation | https://docs.github.com/en |
| Resource center | https://github.com/resources |
| Blog | https://github.blog/ |
| Events & webinars | https://github.com/resources/events |
| Community Forum | https://github.com/orgs/community/discussions |
| Customer Stories | https://github.com/customer-stories |
| Integrations | https://github.com/marketplace |
| Customer support | https://help.github.com/ |
| Training | https://learn.github.com/skills |
| GitHub Status | https://www.githubstatus.com/ |
| About | https://github.com/about |
| Partners | https://github.com/partners |
| Changelog | https://github.blog/changelog/ |
| GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub. | https://githubuniverse.com/ |
| Pricing | https://github.com/pricing |
| Sign in | https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F110223%2Ffiles |
| Sign up | https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=python%2Fcpython |
| Reload | https://github.com/python/cpython/pull/110223/files |
| Reload | https://github.com/python/cpython/pull/110223/files |
| Reload | https://github.com/python/cpython/pull/110223/files |
| python | https://github.com/python |
| cpython | https://github.com/python/cpython |
| Code | https://github.com/python/cpython |
| Issues5k+ (5k+) | https://github.com/python/cpython/issues |
| Pull requests2.4k (2.4k) | https://github.com/python/cpython/pulls |
| Actions | https://github.com/python/cpython/actions |
| Projects | https://github.com/python/cpython/projects |
| Security and quality | https://github.com/python/cpython/security |
| Insights | https://github.com/python/cpython/insights |
| Sign up for GitHub
| https://github.com/signup?return_to=%2Fpython%2Fcpython%2Fissues%2Fnew%2Fchoose |
| terms of service | https://docs.github.com/terms |
| privacy statement | https://docs.github.com/privacy |
| Sign in | https://github.com/login?return_to=%2Fpython%2Fcpython%2Fissues%2Fnew%2Fchoose |
| serhiy-storchaka | https://github.com/serhiy-storchaka |
| python:main | https://github.com/python/cpython/tree/main |
| XuehaiPan:copy-replace-structseq | https://github.com/XuehaiPan/cpython/tree/copy-replace-structseq |
|
Conversation
21
| https://github.com/python/cpython/pull/110223 |
|
Commits
30
| https://github.com/python/cpython/pull/110223/commits |
|
Checks
0
| https://github.com/python/cpython/pull/110223/checks |
|
Files changed
| https://github.com/python/cpython/pull/110223/files |
| Please reload this page | https://github.com/python/cpython/pull/110223/files |
|
gh-110222: Add support of PyStructSequence in copy.replace()
| https://github.com/python/cpython/pull/110223/files#top |
|
Show all changes
30 commits
| https://github.com/python/cpython/pull/110223/files |
|
6af4757
Add support of PyStructSequence in copy.replace()
XuehaiPan Oct 2, 2023
| https://github.com/python/cpython/pull/110223/commits/6af4757e133933c3909635608b2da8a54edb8b6a |
|
1960d8d
Correct error message for `namedtuple._replace`
XuehaiPan Oct 2, 2023
| https://github.com/python/cpython/pull/110223/commits/1960d8dea412f1ce1433b8edcee2fbc5541f71da |
|
5ee97a8
📜🤖 Added by blurb_it.
blurb-it[bot] Oct 2, 2023
| https://github.com/python/cpython/pull/110223/commits/5ee97a8d6173db5afe6473c03f7267fe43b11a13 |
|
e8e6be4
Add test for `copy.replace()` for struct sequence objects
XuehaiPan Oct 2, 2023
| https://github.com/python/cpython/pull/110223/commits/e8e6be484d29124c4fa75ea91cca6a7b260ba247 |
|
43324a4
Move test for `copy.replace(structseq)` to test_structseq.py
XuehaiPan Oct 2, 2023
| https://github.com/python/cpython/pull/110223/commits/43324a4bcbccc9d4a9d7e48bdbddfab5c54c7907 |
|
9e6cd98
Fix refcnt for temp variables
XuehaiPan Oct 2, 2023
| https://github.com/python/cpython/pull/110223/commits/9e6cd98d428981b485127ca0e1fe4a0bc43b9bfe |
|
350a3d0
Change copy.replace() to raise TypeError for unkown fields for named …
XuehaiPan Oct 2, 2023
| https://github.com/python/cpython/pull/110223/commits/350a3d04fa62f27f053c0d06944cb7ef6e416185 |
|
c4655ca
Make copy.replace() to raise TypeError for PyStructSequence with unna…
XuehaiPan Oct 2, 2023
| https://github.com/python/cpython/pull/110223/commits/c4655cabb32533a2bf382433de860eb3a811663c |
|
a9dba93
Revert copy.replace() to raise ValueError for unkown fields for named…
XuehaiPan Oct 2, 2023
| https://github.com/python/cpython/pull/110223/commits/a9dba93357e583b4c9bcc2832a73683b7c31b417 |
|
83fd01b
Change comment in tests
XuehaiPan Oct 2, 2023
| https://github.com/python/cpython/pull/110223/commits/83fd01b1fd6cce307eaa711fad11e3b536494f15 |
|
73e5e65
Add more tests for PyStructSequence with invisible fields
XuehaiPan Oct 2, 2023
| https://github.com/python/cpython/pull/110223/commits/73e5e65cf801460508bf787770a0d95dc68aa809 |
|
7abaf64
Change test function names to match code style
XuehaiPan Oct 2, 2023
| https://github.com/python/cpython/pull/110223/commits/7abaf649deef9372d3a5f98afe86b2643f41647e |
|
26eedbc
Refactor implementation with copy and replacement
XuehaiPan Oct 2, 2023
| https://github.com/python/cpython/pull/110223/commits/26eedbc8518d7e0faad5cb4ae2172817e8c1b735 |
|
d74b449
Fix missing assertHasAttr
XuehaiPan Oct 2, 2023
| https://github.com/python/cpython/pull/110223/commits/d74b44984c4253c6ea4771893ffba314704360b7 |
|
5186c35
Fix test cases
XuehaiPan Oct 2, 2023
| https://github.com/python/cpython/pull/110223/commits/5186c35d1a6b638c5d9718d958d2ea87d24c7e52 |
|
0f74efa
Fix error handling
XuehaiPan Oct 2, 2023
| https://github.com/python/cpython/pull/110223/commits/0f74efaad22897726026587b348065335dc70ae9 |
|
43a81b0
Remove unused variable
XuehaiPan Oct 2, 2023
| https://github.com/python/cpython/pull/110223/commits/43a81b0417b28ccdb73f54b5c1ae02e1d58621f8 |
|
d90e5ae
Cast return type to `PyObject*`
XuehaiPan Oct 2, 2023
| https://github.com/python/cpython/pull/110223/commits/d90e5ae22b9fbf1d0d6221533680eae708f65268 |
|
287f8b0
Merge branch 'main' into copy-replace-structseq
XuehaiPan Oct 2, 2023
| https://github.com/python/cpython/pull/110223/commits/287f8b0395182b2d9e8d3354af70801a0789e316 |
|
5722773
Update news entry
XuehaiPan Oct 2, 2023
| https://github.com/python/cpython/pull/110223/commits/57227732e2d74aef339cccf31ea9841e91898bcf |
|
c23165b
Prefer ++i over i++
XuehaiPan Oct 2, 2023
| https://github.com/python/cpython/pull/110223/commits/c23165b9c72255f9351334f64010a635a01c7103 |
|
38f331b
Limit the length of typename to 500 in error message
XuehaiPan Oct 3, 2023
| https://github.com/python/cpython/pull/110223/commits/38f331b86fda80054a15d606a95ee4d426f9df3c |
|
30758ba
Merge branch 'main' into copy-replace-structseq
XuehaiPan Oct 3, 2023
| https://github.com/python/cpython/pull/110223/commits/30758ba80f65a73e2c56b392991463b603e5f933 |
|
2a6259c
Prefer PyDict_GET_SIZE over PyDict_Size
XuehaiPan Oct 3, 2023
| https://github.com/python/cpython/pull/110223/commits/2a6259c171c23f0659387d8df0f1994a6ef18cfb |
|
a6b0292
Apply suggestions from code review
XuehaiPan Oct 3, 2023
| https://github.com/python/cpython/pull/110223/commits/a6b029266f8b57790677228dcd74ad392217a9a4 |
|
d76bb4e
Apply suggestions from code review
XuehaiPan Oct 3, 2023
| https://github.com/python/cpython/pull/110223/commits/d76bb4e1b044cf4be0bf618e336e735e6523f88a |
|
3ae391f
Update test code style
XuehaiPan Oct 3, 2023
| https://github.com/python/cpython/pull/110223/commits/3ae391f35ab7691e9a2ac10697fcb744a08451b8 |
|
3664109
Merge branch 'main' into copy-replace-structseq
XuehaiPan Oct 3, 2023
| https://github.com/python/cpython/pull/110223/commits/3664109594a75140ea2f262a646d4b4a7da984bf |
|
4a606ad
Apply suggestions from code review
serhiy-storchaka Oct 3, 2023
| https://github.com/python/cpython/pull/110223/commits/4a606ade1dcb5a2a35c9870aa07bb56101fe60ed |
|
8504345
Merge branch 'main' into copy-replace-structseq
XuehaiPan Oct 3, 2023
| https://github.com/python/cpython/pull/110223/commits/85043450024a0392db8d16f8f9f73195506471d4 |
|
Clear filters
| https://github.com/python/cpython/pull/110223/files |
| Please reload this page | https://github.com/python/cpython/pull/110223/files |
| Please reload this page | https://github.com/python/cpython/pull/110223/files |
|
test_structseq.py
| https://github.com/python/cpython/pull/110223/files#diff-4a637803c745f86a5ed3a3bb336b12697a2635ab209994b8c989b8cfae0085ef |
|
2023-10-02-15-07-28.gh-issue-110222.zl_oHh.rst
| https://github.com/python/cpython/pull/110223/files#diff-7d3d596823df5f22dc9d92e706816bed1972fe3dbb6362c5a965e57fafaaa2b5 |
|
structseq.c
| https://github.com/python/cpython/pull/110223/files#diff-6088e5bc32426d02181ea56f5c4acbfc2fef3094c476b8081b22772fe205ccbd |
| Lib/test/test_structseq.py | https://github.com/python/cpython/pull/110223/files#diff-4a637803c745f86a5ed3a3bb336b12697a2635ab209994b8c989b8cfae0085ef |
|
View file
| https://github.com/XuehaiPan/cpython/blob/85043450024a0392db8d16f8f9f73195506471d4/Lib/test/test_structseq.py |
|
Open in desktop
| https://desktop.github.com |
| https://github.co/hiddenchars |
| https://github.com/python/cpython/pull/110223/{{ revealButtonHref }} |
|
| https://github.com/python/cpython/pull/110223/files#diff-4a637803c745f86a5ed3a3bb336b12697a2635ab209994b8c989b8cfae0085ef |
|
| https://github.com/python/cpython/pull/110223/files#diff-4a637803c745f86a5ed3a3bb336b12697a2635ab209994b8c989b8cfae0085ef |
| Misc/NEWS.d/next/Library/2023-10-02-15-07-28.gh-issue-110222.zl_oHh.rst | https://github.com/python/cpython/pull/110223/files#diff-7d3d596823df5f22dc9d92e706816bed1972fe3dbb6362c5a965e57fafaaa2b5 |
|
View file
| https://github.com/XuehaiPan/cpython/blob/85043450024a0392db8d16f8f9f73195506471d4/Misc/NEWS.d/next/Library/2023-10-02-15-07-28.gh-issue-110222.zl_oHh.rst |
|
Open in desktop
| https://desktop.github.com |
| https://github.co/hiddenchars |
| https://github.com/python/cpython/pull/110223/{{ revealButtonHref }} |
| Objects/structseq.c | https://github.com/python/cpython/pull/110223/files#diff-6088e5bc32426d02181ea56f5c4acbfc2fef3094c476b8081b22772fe205ccbd |
|
View file
| https://github.com/XuehaiPan/cpython/blob/85043450024a0392db8d16f8f9f73195506471d4/Objects/structseq.c |
|
Open in desktop
| https://desktop.github.com |
| https://github.co/hiddenchars |
| https://github.com/python/cpython/pull/110223/{{ revealButtonHref }} |
|
| https://github.com/python/cpython/pull/110223/files#diff-6088e5bc32426d02181ea56f5c4acbfc2fef3094c476b8081b22772fe205ccbd |
|
| https://github.com/python/cpython/pull/110223/files#diff-6088e5bc32426d02181ea56f5c4acbfc2fef3094c476b8081b22772fe205ccbd |
|
| https://github.com/python/cpython/pull/110223/files#diff-6088e5bc32426d02181ea56f5c4acbfc2fef3094c476b8081b22772fe205ccbd |
|
| https://github.com/python/cpython/pull/110223/files#diff-6088e5bc32426d02181ea56f5c4acbfc2fef3094c476b8081b22772fe205ccbd |
|
| https://github.com |
| Terms | https://docs.github.com/site-policy/github-terms/github-terms-of-service |
| Privacy | https://docs.github.com/site-policy/privacy-policies/github-privacy-statement |
| Security | https://github.com/security |
| Status | https://www.githubstatus.com/ |
| Community | https://github.community/ |
| Docs | https://docs.github.com/ |
| Contact | https://support.github.com?tags=dotcom-footer |