Skip to content
This repository has been archived by the owner on Jan 25, 2024. It is now read-only.

Use Collections metaclasses to do BoardGroups #23

Closed
trickeydan opened this issue Feb 3, 2019 · 7 comments
Closed

Use Collections metaclasses to do BoardGroups #23

trickeydan opened this issue Feb 3, 2019 · 7 comments
Assignees
Labels
enhancement New feature or request refactor wontfix This will not be worked on
Milestone

Comments

@trickeydan
Copy link
Contributor

No description provided.

@kierdavis
Copy link
Contributor

Let's wait for a decision on #37 before implementing this, as the outcome will affect which metaclass we use.

@kierdavis
Copy link
Contributor

The outcome of #37 was that BoardGroups should be ordered (by serial number), so I think Sequence is the right metaclass to use here.

@kierdavis
Copy link
Contributor

Actually, looking at the current implementation its more like an ordered Mapping.

@kierdavis
Copy link
Contributor

Implementing collections.abc.Mapping would require us to change BoardGroup.__iter__ to iterate over keys (serial numbers) rather than values (boards). Maybe this isn't worth the effort. What do you think @trickeydan?

@trickeydan
Copy link
Contributor Author

I think it would be really unintuitive if iteration was over serial numbers rather than boards.

I also agree that collections.abc.Mapping is most appropriate.

I think this might be a wontfix 😥

@kierdavis
Copy link
Contributor

We lose out on a few automatically-provided methods, most of which are probably unimportant. The only useful-looking one is __contains__ which already has its own issue open (#241). I'm happy to call this a wontfix.

@Skybound1
Copy link
Contributor

I can't think of a class of the top of my head which acts like a dictionary, but iterates over values... so if __contains__ is the only useful one, I'd agree not fixing and just implementing that is the easiest path to take.

@trickeydan trickeydan added the wontfix This will not be worked on label Apr 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request refactor wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

3 participants