程序员最近都爱上了这个网站  程序员们快来瞅瞅吧!  it98k网:it98k.com

本站消息

站长简介/公众号

  出租广告位,需要合作请联系站长

+关注
已关注

分类  

暂无分类

标签  

暂无标签

日期归档  

暂无数据

Python Collections 模块 - 1

发布于2020-03-18 11:54     阅读(1265)     评论(0)     点赞(28)     收藏(2)


 

  1. # -*- coding: utf-8 -*-
  2. __autor__ = "TOM"
  3. from collections import *
  4. # 抽象基类interface
  5. from collections.abc import *

collection支持的数据类型

  1. '''This module implements specialized container datatypes providing
  2. alternatives to Python's general purpose built-in containers, dict,
  3. list, set, and tuple.
  4. * namedtuple factory function for creating tuple subclasses with named fields
  5. * deque list-like container with fast appends and pops on either end
  6. * ChainMap dict-like class for creating a single view of multiple mappings
  7. * Counter dict subclass for counting hashable objects
  8. * OrderedDict dict subclass that remembers the order entries were added
  9. * defaultdict dict subclass that calls a factory function to supply missing values
  10. * UserDict wrapper around dictionary objects for easier dict subclassing
  11. * UserList wrapper around list objects for easier list subclassing
  12. * UserString wrapper around string objects for easier string subclassing
  13. '''
  14. __all__ = ['deque', 'defaultdict', 'namedtuple', 'UserDict', 'UserList',
  15. 'UserString', 'Counter', 'OrderedDict', 'ChainMap']

 

原文链接:https://blog.csdn.net/f2157120/article/details/104914986



所属网站分类: 技术文章 > 博客

作者:sjhjf0293

链接:https://www.pythonheidong.com/blog/article/265457/1db6532a03574a152512/

来源:python黑洞网

任何形式的转载都请注明出处,如有侵权 一经发现 必将追究其法律责任

28 0
收藏该文
已收藏

评论内容:(最多支持255个字符)