Title: Upgrade timeit module from Python 3.14.2 by Copilot · Pull Request #6854 · RustPython/RustPython · GitHub
Open Graph Title: Upgrade timeit module from Python 3.14.2 by Copilot · Pull Request #6854 · RustPython/RustPython
X Title: Upgrade timeit module from Python 3.14.2 by Copilot · Pull Request #6854 · RustPython/RustPython
Description: Upgrades timeit module and its test suite from CPython 3.14.2.
Changes
timeit.py: Updated to 3.14.2 with gc.disable/enable wrapped in try-except to handle NotImplementedError in RustPython
test_timeit.py: Updated to 3.14.2 with newer assertStartsWith assertions
Compatibility Fix
The updated CPython version uses gc.disable() and gc.enable(), which raise NotImplementedError in RustPython's partial gc implementation:
try:
gcold = gc.isenabled()
gc.disable()
except NotImplementedError:
gcold = False
try:
timing = self.inner(it, self.timer)
finally:
if gcold:
try:
gc.enable()
except NotImplementedError:
pass
All 41 tests pass.
Original prompt
This section details on the original issue you should resolve
Open Graph Description: Upgrades timeit module and its test suite from CPython 3.14.2. Changes timeit.py: Updated to 3.14.2 with gc.disable/enable wrapped in try-except to handle NotImplementedError in RustPython test_ti...
X Description: Upgrades timeit module and its test suite from CPython 3.14.2. Changes timeit.py: Updated to 3.14.2 with gc.disable/enable wrapped in try-except to handle NotImplementedError in RustPython test_ti...
Opengraph URL: https://github.com/RustPython/RustPython/pull/6854
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:b5959066-d904-c8cc-04ce-19a60e3caee5 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | DE9A:116E4B:5801A59:73829C1:6A5DA565 |
| html-safe-nonce | 99db3da09c5c9dba465bebf0a53928ba811207140cbebab4e430fa8c26d51ea7 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJERTlBOjExNkU0Qjo1ODAxQTU5OjczODI5QzE6NkE1REE1NjUiLCJ2aXNpdG9yX2lkIjoiODQ5ODIxOTI2NTE0NTI4Mzk0MSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 06dc31fa163c5733b4d540c73f6f01cc383ad1a1550979cc9bbfdc4413669b2d |
| hovercard-subject-tag | pull_request:3205510474 |
| 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/RustPython/RustPython/pull/6854/files |
| twitter:image | https://avatars.githubusercontent.com/in/1143301?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/in/1143301?s=400&v=4 |
| og:image:alt | Upgrades timeit module and its test suite from CPython 3.14.2. Changes timeit.py: Updated to 3.14.2 with gc.disable/enable wrapped in try-except to handle NotImplementedError in RustPython test_ti... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5290d7e14309ad1e76106a9c4237bd1041517e83ea182c8ab756752cb0c6940b |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/RustPython/RustPython git https://github.com/RustPython/RustPython.git |
| octolytics-dimension-user_id | 39710557 |
| octolytics-dimension-user_login | RustPython |
| octolytics-dimension-repository_id | 135201145 |
| octolytics-dimension-repository_nwo | RustPython/RustPython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 135201145 |
| octolytics-dimension-repository_network_root_nwo | RustPython/RustPython |
| 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 | 9c975978430e9ad293956f2bbdaf153b1bd84a99 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width