About 5,730,000 results
Open links in new tab
  1. namedtuple vs NamedTuple in Python - Stack Overflow

    The type generated by subclassing typing.NamedTuple is equivalent to a collections.namedtuple, but with __annotations__, _field_types and _field_defaults attributes added. The generated …

  2. python - cannot import name 'MutableMapping' from 'collections' …

    Jan 26, 2022 · If you have this issue a simple method to patch the issue for 3.10 is to port back the library into collections instead of bothering about changing third party code, or your own …

  3. Newest 'python-collections' Questions - Stack Overflow

    May 23, 2025 · Python 3.9 includes PEP 585 and deprecates many of the types in the typing module in favor of the ones in collections.abc, now that they support __class_getitem__.

  4. How to sort Counter by value? - python - Stack Overflow

    Other than doing list comprehensions of reversed list comprehension, is there a pythonic way to sort Counter by value? If so, it is faster than this: >>> from collections import Counter &...

  5. python - Difference between collections.abc.Sequence and typing ...

    Jan 30, 2023 · I was reading an article and about collection.abc and typing class in the python standard library and discover both classes have the same features. I tried both options using …

  6. python - Cannot import name 'Mapping' from 'collections' - Stack …

    Jul 7, 2022 · from collections.abc import Sequence Additionally my project .py file still had the legacy code line import collections which I replaced with the new code line from …

  7. python - collections.Iterable vs typing.Iterable in type annotation …

    Oct 16, 2018 · Due to PEP 585 - Type Hinting Generics In Standard Collections, Python's standard library container types are also able to accept a generic argument for type …

  8. Can anyone tell me how to install collections package in python 3.9?

    Jan 25, 2021 · Can anyone tell me how to install collections package in python 3.9? [duplicate] Asked 4 years, 9 months ago Modified 4 years, 9 months ago Viewed 11k times

  9. python - efficient circular buffer? - Stack Overflow

    Mar 16, 2016 · I want to create an efficient circular buffer in python (with the goal of taking averages of the integer values in the buffer). Is this an efficient way to use a list to collect …

  10. python - What is isinstance with a dictionary and abc.Mapping …

    Feb 29, 2016 · The collections.abc module provides several abstract base classes that can be used to generically describe the various kinds of data structures in Python. In your example, …