Title: gh-100933: Improve `check_element` helper in `test_xml_etree` by sobolevn · Pull Request #100934 · python/cpython · GitHub
Open Graph Title: gh-100933: Improve `check_element` helper in `test_xml_etree` by sobolevn · Pull Request #100934 · python/cpython
X Title: gh-100933: Improve `check_element` helper in `test_xml_etree` by sobolevn · Pull Request #100934 · python/cpython
Description: Items that this test checks are always str and dict: attrib: cpython/Modules/_elementtree.c Lines 536 to 548 in a9f0144 element_get_attrib(ElementObject* self) { /* return borrowed reference to attrib dictionary */ /* note: this function assumes that the extra section exists */ PyObject* res = self->extra->attrib; if (!res) { /* create missing dictionary */ res = self->extra->attrib = PyDict_New(); } return res; text: cpython/Modules/_elementtree.c Lines 561 to 564 in a9f0144 PyObject *tmp = list_join(res); if (!tmp) return NULL; self->text = tmp; tail: cpython/Modules/_elementtree.c Lines 582 to 585 in a9f0144 PyObject *tmp = list_join(res); if (!tmp) return NULL; self->tail = tmp; As you can see, there are no "custom" types that should be checked differently. isinstance is enough. test_xml_etree_c is also affected by this change.
Open Graph Description: Items that this test checks are always str and dict: attrib: cpython/Modules/_elementtree.c Lines 536 to 548 in a9f0144 ...
X Description: Items that this test checks are always str and dict: attrib: cpython/Modules/_elementtree.c Lines 536 to 548 in a9f0144 ...
Opengraph URL: https://github.com/python/cpython/pull/100934
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:3a656947-bae2-4928-4203-1534886516a9 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 85DE:291671:ABD64:EC1BA:6969D22A |
| html-safe-nonce | d0aaa0702f6290d10870913d69cfcc1c7ecdee4fe28606622753d1693b42bd52 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NURFOjI5MTY3MTpBQkQ2NDpFQzFCQTo2OTY5RDIyQSIsInZpc2l0b3JfaWQiOiI3NDExNDI1NzA1NTMxNjU4Nzk0IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 141592a1432178024c1768f2470e34e3509dbbe451ba01604dbaf0ebc6e30b61 |
| hovercard-subject-tag | pull_request:1193561962 |
| 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 | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/python/cpython/pull/100934/files |
| twitter:image | https://avatars.githubusercontent.com/u/4660275?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/4660275?s=400&v=4 |
| og:image:alt | Items that this test checks are always str and dict: attrib: cpython/Modules/_elementtree.c Lines 536 to 548 in a9f0144 ... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | acedec8b5f975d9e3d494ddd8f949b0b8a0de59d393901e26f73df9dcba80056 |
| 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 |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 83c08c21cdda978090dc44364b71aa5bc6dcea79 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width