Title: Use _PyObject_LookupAttr() instead of PyObject_GetAttr() · Issue #106303 · python/cpython · GitHub
Open Graph Title: Use _PyObject_LookupAttr() instead of PyObject_GetAttr() · Issue #106303 · python/cpython
X Title: Use _PyObject_LookupAttr() instead of PyObject_GetAttr() · Issue #106303 · python/cpython
Description: PyObject_GetAttr() followed by PyErr_ExceptionMatches(PyExc_AttributeError) and PyErr_Clear() can be replaced with _PyObject_LookupAttr(). It is faster, because it avoids raising the AttributeError exception which later be caught and dro...
Open Graph Description: PyObject_GetAttr() followed by PyErr_ExceptionMatches(PyExc_AttributeError) and PyErr_Clear() can be replaced with _PyObject_LookupAttr(). It is faster, because it avoids raising the AttributeError...
X Description: PyObject_GetAttr() followed by PyErr_ExceptionMatches(PyExc_AttributeError) and PyErr_Clear() can be replaced with _PyObject_LookupAttr(). It is faster, because it avoids raising the AttributeError...
Opengraph URL: https://github.com/python/cpython/issues/106303
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Use _PyObject_LookupAttr() instead of PyObject_GetAttr()","articleBody":"`PyObject_GetAttr()` followed by `PyErr_ExceptionMatches(PyExc_AttributeError)` and `PyErr_Clear()` can be replaced with `_PyObject_LookupAttr()`. It is faster, because it avoids raising the AttributeError exception which later be caught and dropped at first place. And it leads to simpler code. Most of code already uses `_PyObject_LookupAttr()`, but some new code was added recently which still use the old idiom.\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-106304\n* gh-106568\n* gh-106569\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/serhiy-storchaka","@type":"Person","name":"serhiy-storchaka"},"datePublished":"2023-07-01T08:00:42.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/106303/cpython/issues/106303"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:802f9afa-a0b1-fd36-703f-f49c235e0aa9 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D3AC:108FC:6909C0:8C3D66:6A5306A6 |
| html-safe-nonce | 829960338e31f8c0402ed0d8face9d5e3bce6fe2a1dc926fd0202637a2df3690 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEM0FDOjEwOEZDOjY5MDlDMDo4QzNENjY6NkE1MzA2QTYiLCJ2aXNpdG9yX2lkIjoiMTQ2MTA1NDc3NzA0NjQ4MzU4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 496204ae1379863449e90ca45b21c0afb258051645db01d71801098cd2d3ee02 |
| hovercard-subject-tag | issue:1783649135 |
| github-keyboard-shortcuts | repository,issues,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/_view_fragments/issues/show/python/cpython/106303/issue_layout |
| twitter:image | https://opengraph.githubassets.com/03358e71acd9843c73783ea8d1372b0e96d63907efc2ff2a8ff8af0955575a4d/python/cpython/issues/106303 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/03358e71acd9843c73783ea8d1372b0e96d63907efc2ff2a8ff8af0955575a4d/python/cpython/issues/106303 |
| og:image:alt | PyObject_GetAttr() followed by PyErr_ExceptionMatches(PyExc_AttributeError) and PyErr_Clear() can be replaced with _PyObject_LookupAttr(). It is faster, because it avoids raising the AttributeError... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | serhiy-storchaka |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-preview |
| 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 | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 07a982c1d40157c619b364352b704c3ce66bb332 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width