Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python 3.13.1 broke [s for s in sl] where sl is a SectionList. #3276

Merged
merged 4 commits into from
Dec 9, 2024

Conversation

nrnhines
Copy link
Member

@nrnhines nrnhines commented Dec 7, 2024

This PR fixes (works around?) the following Python-3.13.1 error:

$ python
Python 3.13.1 (main, Dec  6 2024, 07:50:24) [GCC 13.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from neuron import h
>>> sl = h.SectionList()
>>> [s for s in sl]
Traceback (most recent call last):
  File "<python-input-2>", line 1, in <module>
    [s for s in sl]
                ^^
TypeError: Not an iterable HocObject
>>> 

It also provides the len function, ie. given the above empty sl

>>> len(sl)
0

@nrnhines nrnhines requested a review from JCGoran December 7, 2024 11:04
src/nrnpython/nrnpy_hoc.cpp Outdated Show resolved Hide resolved
Copy link

✔️ bf3cc7e -> Azure artifacts URL

Copy link

codecov bot commented Dec 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 67.05%. Comparing base (47b0359) to head (836a96d).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3276      +/-   ##
==========================================
- Coverage   67.06%   67.05%   -0.01%     
==========================================
  Files         571      571              
  Lines      111072   111080       +8     
==========================================
- Hits        74493    74489       -4     
- Misses      36579    36591      +12     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@bbpbuildbot

This comment has been minimized.

Copy link
Collaborator

@JCGoran JCGoran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, nice work!

@JCGoran JCGoran mentioned this pull request Dec 8, 2024
2 tasks
@nrnhines nrnhines enabled auto-merge (squash) December 9, 2024 13:28
Copy link

sonarqubecloud bot commented Dec 9, 2024

Copy link

✔️ 836a96d -> Azure artifacts URL

@nrnhines nrnhines merged commit 00ba007 into master Dec 9, 2024
36 checks passed
@nrnhines nrnhines deleted the hines/seclist-iter branch December 9, 2024 15:10
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