Skip to content

reduce code overhead in setitem-style iRODSMeta assignments #835

Description

@d-w-moore

If d.metadata[key] is the access for getting/setting a single AVU, it seems excessive to require client applications to do this:

d.metadata[ key ] = iRODSMeta( key, 'myValue', 'myUnits')

i.e. duplicated mention of the key value.
It's currently required however, and if the first argument to iRODSMeta constructor does not match the __setitem__ assignment key, an error is generated. Much preferable would be this form:

d.metadata[ key ] = iRODSMeta.builder( value='myValue' [, units='myUnits' ])

Which is easy to implement via functools.partial and collections.namedtuple.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions