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

Namelist print fail when containing generic objects #103

Open
marshallward opened this issue Jun 26, 2019 · 0 comments
Open

Namelist print fail when containing generic objects #103

marshallward opened this issue Jun 26, 2019 · 0 comments
Labels

Comments

@marshallward
Copy link
Owner

As discussed in #102, namelists can be silently initialised with arbitrary objects, but operations which use __str__ will fail since there is no valid Fortran representation. Example:

import f90nml
class C(object):
    pass

c = C()
d = {'config_nml': {'x': c}}
nml = f90nml.Namelist(d)    # No error here
print(nml)
# various errors...

Current proposal is to check for valid input at initialization, although this may exacerbate some of the performance issues observed in #99.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant