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

Section: dict-like section creation #104

Closed
gicmo opened this issue Dec 4, 2014 · 0 comments
Closed

Section: dict-like section creation #104

gicmo opened this issue Dec 4, 2014 · 0 comments

Comments

@gicmo
Copy link
Member

gicmo commented Dec 4, 2014

On the mission to make working with metadata as close to dicts (and pythonic) as possible there is not that much missing. For the object creation, the properties side of things has been solved with pr #101. The thing that remains is creation of sections, currently done via section.create_section('name', 'type')
Following ideas came to my mind:
Create section via __setitem__ and a tuple, i.e. s['new section'] = ('type'). If people fear that this is too confusing to value creation (which is done via lists, i.e. s['prop'] = [1, 2, 3]) then maybe we could introduce a dummy class (e.g. a collections.namedtuple) with a short name (nix.S): s['new section'] = nix.S('type').
I think I personally prefer the first version, i.e. the tuple based approach.

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

No branches or pull requests

1 participant