Add __len__ to ItemPaged class
See original GitHub issueIs your feature request related to a problem? Please describe.
For the class ItemPaged at
It would be nice to add __len__ function.
Describe the solution you’d like
Because it’s an iterator using len() on it will give TypeError: object of type 'ItemPaged' has no len(). Yes you can use len(list()), but it’s too wordy.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
azure.core.paging.ItemPaged class - Microsoft Learn
This sample shows how to manage your storage account using the Azure Storage Management package for Python. The Storage Resource Provider is a...
Read more >How should Azure ItemPaged iterator work? - Stack Overflow
The length of pathlist is 5000. According to documentation - it is default max_results for page, as the output of get_pages() is the...
Read more >Making the len function work on your Python objects
In Python, you can make the built-in len function work on your objects. The len function only works on objects that have a...
Read more >Python Guidelines: Implementation | Azure SDKs
LROPoller; ItemPaged; DiagnosticsResponseHook ... This is achieved by using the CaseInsensitiveEnumMeta class defined in azure-core .
Read more >AttributeError: 'list' object has no attribute 'len' | bobbyhadz
To solve the error, pass the list to the `len` function to get its length, ... it returns a list of names of...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This is such a basic requirement, couldn’t you add a count function? There are a lot of lazily loaded collections that do this.
ditto to the above, len is such a fundamental attribute of any collection