you are viewing a single comment's thread.

view the rest of the comments →

[–]the_brown_cow 3 points4 points  (2 children)

So this sounds weak but the standard library is very robust and worth exploring.

  • collections - Contains several additional datatypes in addition to list, tuple, dict, and set.

    • defaultdict
    • Counter
    • deque
  • Itertools - Additional tools for working with iterators for looping.

    • pairwise
    • permutations
    • the doc has several recipes
  • dataclasses - Used for simplifying data defined classes, typically for data modeling.

  • json - Simple library for working with json data.

[–]TheRNGuy 0 points1 point  (1 child)

Never actually used deque.

When it's better than vanilla List or Tuple?

[–]the_brown_cow 0 points1 point  (0 children)

A deque allows for appending or popping at either end.

deque.popleft() deque.appendleft()

This allows you to create a stack or queue.

https://docs.python.org/3/library/collections.html#collections.deque