Skip to content

Fix find_replacements with Python 3.13#39185

Merged
vbraun merged 3 commits intosagemath:developfrom
antonio-rojas:python-3.13-eval
Jan 18, 2025
Merged

Fix find_replacements with Python 3.13#39185
vbraun merged 3 commits intosagemath:developfrom
antonio-rojas:python-3.13-eval

Conversation

@antonio-rojas
Copy link
Contributor

@antonio-rojas antonio-rojas commented Dec 22, 2024

After PEP 667 implementation [1] globals() changes within an exec call are not propagated outside the call

[1] python/cpython@b034f14

@github-actions
Copy link

github-actions bot commented Dec 22, 2024

Documentation preview for this PR (built with commit cee808a; changes) is ready! 🎉
This preview will update shortly after each push to this PR.

@user202729
Copy link
Contributor

Instead of using globals() you can probably just use a temporary dict. Otherwise there's a risk of memory leak (the refcount isn't decreased when the function returns)

After PEP 667 implementation [1] locals() changes within an exec call are not propagated outside the call

[1] python/cpython@b034f14
vbraun pushed a commit to vbraun/sage that referenced this pull request Jan 7, 2025
sagemathgh-39185: Fix find_replacements with Python 3.13
    
After PEP 667 implementation [1] `globals()` changes within an `exec`
call are not propagated outside the call

[1] python/cpython@b034f14a4b6e9197d3926046721
b8b4b4b4f5b3d
    
URL: sagemath#39185
Reported by: Antonio Rojas
Reviewer(s): user202729
vbraun pushed a commit to vbraun/sage that referenced this pull request Jan 7, 2025
sagemathgh-39188: Declare Python 3.13 as supported in sagelib
    
### ⌛ Dependencies
- sagemath#39145
- sagemath#39147
- sagemath#39182
- sagemath#39184
- sagemath#39185
- sagemath#39187
- sagemath#39201
    
URL: sagemath#39188
Reported by: Antonio Rojas
Reviewer(s): Tobias Diez
vbraun pushed a commit to vbraun/sage that referenced this pull request Jan 9, 2025
sagemathgh-39185: Fix find_replacements with Python 3.13
    
After PEP 667 implementation [1] `globals()` changes within an `exec`
call are not propagated outside the call

[1] python/cpython@b034f14a4b6e9197d3926046721
b8b4b4b4f5b3d
    
URL: sagemath#39185
Reported by: Antonio Rojas
Reviewer(s): user202729
vbraun pushed a commit to vbraun/sage that referenced this pull request Jan 9, 2025
sagemathgh-39188: Declare Python 3.13 as supported in sagelib
    
### ⌛ Dependencies
- sagemath#39145
- sagemath#39147
- sagemath#39182
- sagemath#39184
- sagemath#39185
- sagemath#39187
- sagemath#39201
    
URL: sagemath#39188
Reported by: Antonio Rojas
Reviewer(s): Tobias Diez
vbraun pushed a commit to vbraun/sage that referenced this pull request Jan 10, 2025
sagemathgh-39185: Fix find_replacements with Python 3.13
    
After PEP 667 implementation [1] `globals()` changes within an `exec`
call are not propagated outside the call

[1] python/cpython@b034f14a4b6e9197d3926046721
b8b4b4b4f5b3d
    
URL: sagemath#39185
Reported by: Antonio Rojas
Reviewer(s): user202729
vbraun pushed a commit to vbraun/sage that referenced this pull request Jan 10, 2025
sagemathgh-39188: Declare Python 3.13 as supported in sagelib
    
### ⌛ Dependencies
- sagemath#39145
- sagemath#39147
- sagemath#39182
- sagemath#39184
- sagemath#39185
- sagemath#39187
- sagemath#39201
    
URL: sagemath#39188
Reported by: Antonio Rojas
Reviewer(s): Tobias Diez
vbraun pushed a commit to vbraun/sage that referenced this pull request Jan 12, 2025
sagemathgh-39185: Fix find_replacements with Python 3.13
    
After PEP 667 implementation [1] `globals()` changes within an `exec`
call are not propagated outside the call

[1] python/cpython@b034f14a4b6e9197d3926046721
b8b4b4b4f5b3d
    
URL: sagemath#39185
Reported by: Antonio Rojas
Reviewer(s): user202729
vbraun pushed a commit to vbraun/sage that referenced this pull request Jan 12, 2025
sagemathgh-39188: Declare Python 3.13 as supported in sagelib
    
### ⌛ Dependencies
- sagemath#39145
- sagemath#39147
- sagemath#39182
- sagemath#39184
- sagemath#39185
- sagemath#39187
- sagemath#39201
    
URL: sagemath#39188
Reported by: Antonio Rojas
Reviewer(s): Tobias Diez
vbraun pushed a commit to vbraun/sage that referenced this pull request Jan 16, 2025
sagemathgh-39185: Fix find_replacements with Python 3.13
    
After PEP 667 implementation [1] `globals()` changes within an `exec`
call are not propagated outside the call

[1] python/cpython@b034f14a4b6e9197d3926046721
b8b4b4b4f5b3d
    
URL: sagemath#39185
Reported by: Antonio Rojas
Reviewer(s): user202729
vbraun pushed a commit to vbraun/sage that referenced this pull request Jan 16, 2025
sagemathgh-39188: Declare Python 3.13 as supported in sagelib
    
### ⌛ Dependencies
- sagemath#39145
- sagemath#39147
- sagemath#39182
- sagemath#39184
- sagemath#39185
- sagemath#39187
- sagemath#39201
    
URL: sagemath#39188
Reported by: Antonio Rojas
Reviewer(s): Tobias Diez
vbraun pushed a commit to vbraun/sage that referenced this pull request Jan 17, 2025
sagemathgh-39188: Declare Python 3.13 as supported in sagelib
    
### ⌛ Dependencies
- sagemath#39145
- sagemath#39147
- sagemath#39182
- sagemath#39184
- sagemath#39185
- sagemath#39187
- sagemath#39201
    
URL: sagemath#39188
Reported by: Antonio Rojas
Reviewer(s): Tobias Diez
@vbraun vbraun merged commit 57fa958 into sagemath:develop Jan 18, 2025
@antonio-rojas antonio-rojas deleted the python-3.13-eval branch January 18, 2025 11:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants