Skip to content

__getattr__ but no __setattr__ implemented on ports causing confusion...  #686

Open
@carldlaird

Description

@carldlaird

_PortData implements getattr to support accessing .vars['foo'] using the attribute ".foo". This caused me confusion since m.port.foo returned a simple var, but m.port.foo = 42 failed.

Should we have design discussion here about the symmetry and either implement setattr or not implement getattr (or somehow return a more helpful error when we try m.port.foo = 42)?

@gseastream (Thoughts?)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions