You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been configuring arguments like the one above in project, which is mainly python 3.10 (& 3.9), but this doesn't work since python 3.11.
The reason for this is that as of python 3.11, list[Optimizer] is False in inspect.isclass().
raiseValueError(f"Expected 'baseclass' argument to be a class or a tuple of classes: {baseclass}")
If I comment out that if statement and the raise statement, this works fine.
Do I need to use a different method to use list[Optimizer] or list[Scheduler]?
This used to work in python 3.9 and 3.10, but a new workaround is needed in 3.11.
I was wondering if could relax that if statement to make it more flexible.
To reproduce
Expected behavior
Environment
jsonargparse version (e.g., 4.8.0):
Python version (e.g., 3.9):
How jsonargparse was installed (e.g. pip install jsonargparse[all]):
OS (e.g., Linux):
The text was updated successfully, but these errors were encountered:
harimkang
changed the title
In python 3.11, add_subclass_arguments with list[Optimizer] is not working.
In python 3.11, add_subclass_arguments with list[Class] is not working.
Feb 22, 2024
🐛 Bug report
Hi all, I'm working on a project that utilizes this great library.
However, I ran into a problem with python 3.11.
I've been configuring arguments like the one above in project, which is mainly python 3.10 (& 3.9), but this doesn't work since python 3.11.
The reason for this is that as of python 3.11,
list[Optimizer]
is False ininspect.isclass()
.jsonargparse/jsonargparse/_signatures.py
Lines 502 to 503 in 88fc9c8
If I comment out that if statement and the raise statement, this works fine.
Do I need to use a different method to use
list[Optimizer]
orlist[Scheduler]
?This used to work in python 3.9 and 3.10, but a new workaround is needed in 3.11.
I was wondering if could relax that if statement to make it more flexible.
To reproduce
Expected behavior
Environment
pip install jsonargparse[all]
):The text was updated successfully, but these errors were encountered: