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

Request: Item.count #13

Open
kgish opened this issue Dec 9, 2014 · 2 comments
Open

Request: Item.count #13

kgish opened this issue Dec 9, 2014 · 2 comments

Comments

@kgish
Copy link

kgish commented Dec 9, 2014

I would like to request to implement item.count similar to folder.count but giving the number of properties (name-value pairs) in that item

@kgish kgish changed the title Item.count Request: Item.count Dec 9, 2014
@jelly
Copy link
Collaborator

jelly commented Dec 10, 2014

Item.count does not really sound very logical? What does it count?
And you can easily do the following

len(item.props())

And if you are already enumerating over the props() generator just do:

for i, prop in enumerate(item.props()):
    print i, prop

@kgish
Copy link
Author

kgish commented Dec 10, 2014

Yes, that works as well. Just figured that with folder which is a container holding items and there is a count method folder.count that for a given item which is a container holding props that it'd make sense also to have a count method item.count

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

No branches or pull requests

2 participants