Python builtins

>>> dir (__builtins__)
[‘ArithmeticError‘, ‘AssertionError‘, ‘AttributeError‘, ‘BaseException‘, ‘BlockingIOError‘, ‘BrokenPipeError‘, ‘BufferError‘, ‘BytesWarning‘, ‘ChildProcessError‘, ‘ConnectionAbortedError‘, ‘ConnectionError‘, ‘ConnectionRefusedError‘, ‘ConnectionResetError‘, ‘DeprecationWarning‘, ‘EOFError‘, ‘Ellipsis‘, ‘EnvironmentError‘, ‘Exception‘, ‘False‘, ‘FileExistsError‘, ‘FileNotFoundError‘, ‘FloatingPointError‘, ‘FutureWarning‘, ‘GeneratorExit‘, ‘IOError‘, ‘ImportError‘, ‘ImportWarning‘, ‘IndentationError‘, ‘IndexError‘, ‘InterruptedError‘, ‘IsADirectoryError‘, ‘KeyError‘, ‘KeyboardInterrupt‘, ‘LookupError‘, ‘MemoryError‘, ‘NameError‘, ‘None‘, ‘NotADirectoryError‘, ‘NotImplemented‘, ‘NotImplementedError‘, ‘OSError‘, ‘OverflowError‘, ‘PendingDeprecationWarning‘, ‘PermissionError‘, ‘ProcessLookupError‘, ‘ReferenceError‘, ‘ResourceWarning‘, ‘RuntimeError‘, ‘RuntimeWarning‘, ‘StopIteration‘, ‘SyntaxError‘, ‘SyntaxWarning‘, ‘SystemError‘, ‘SystemExit‘, ‘TabError‘, ‘TimeoutError‘, ‘True‘, ‘TypeError‘, ‘UnboundLocalError‘, ‘UnicodeDecodeError‘, ‘UnicodeEncodeError‘, ‘UnicodeError‘, ‘UnicodeTranslateError‘, ‘UnicodeWarning‘, ‘UserWarning‘, ‘ValueError‘, ‘Warning‘, ‘WindowsError‘, ‘ZeroDivisionError‘, ‘_‘, ‘__build_class__‘, ‘__debug__‘, ‘__doc__‘, ‘__import__‘, ‘__loader__‘, ‘__name__‘, ‘__package__‘, ‘__spec__‘, ‘abs‘, ‘all‘, ‘any‘, ‘ascii‘, ‘bin‘, ‘bool‘, ‘bytearray‘, ‘bytes‘, ‘callable‘, ‘chr‘, ‘classmethod‘, ‘compile‘, ‘complex‘, ‘copyright‘, ‘credits‘, ‘delattr‘, ‘dict‘, ‘dir‘, ‘divmod‘, ‘enumerate‘, ‘eval‘, ‘exec‘, ‘exit‘, ‘filter‘, ‘float‘, ‘format‘, ‘frozenset‘, ‘getattr‘, ‘globals‘, ‘hasattr‘, ‘hash‘, ‘help‘, ‘hex‘, ‘id‘, ‘input‘, ‘int‘, ‘isinstance‘, ‘issubclass‘, ‘iter‘, ‘len‘, ‘license‘, ‘list‘, ‘locals‘, ‘map‘, ‘max‘, ‘memoryview‘, ‘min‘, ‘next‘, ‘object‘, ‘oct‘, ‘open‘, ‘ord‘, ‘pow‘, ‘print‘, ‘property‘, ‘quit‘, ‘range‘, ‘repr‘, ‘reversed‘, ‘round‘, ‘set‘, ‘setattr‘, ‘slice‘, ‘sorted‘, ‘staticmethod‘, ‘str‘, ‘sum‘, ‘super‘, ‘tuple‘, ‘type‘, ‘vars‘, ‘zip‘]
>>> help (zip)
Help on class zip in module builtins:

class zip(object)
 |  zip(iter1 [,iter2 [...]]) --> zip object
 |
 |  Return a zip object whose .__next__() method returns a tuple where
 |  the i-th element comes from the i-th iterable argument.  The .__next__()
 |  method continues until the shortest iterable in the argument sequence
 |  is exhausted and then it raises StopIteration.
 |
 |  Methods defined here:
 |
 |  __getattribute__(self, name, /)
 |      Return getattr(self, name).
 |
 |  __iter__(self, /)
 |      Implement iter(self).
 |
 |  __new__(*args, **kwargs) from builtins.type
 |      Create and return a new object.  See help(type) for accurate signature.
 |
 |  __next__(self, /)
 |      Implement next(self).
 |
 |  __reduce__(...)
 |      Return state information for pickling.
时间: 2024-08-06 03:59:00

Python builtins的相关文章

C++变得越来越像Python的证据

http://preshing.com/20141202/cpp-has-become-more-pythonic/ C++ Has Become More Pythonic C++ has changed a lot in recent years. The last two revisions, C++11 and C++14, introduce so many new features that, in the words of Bjarne Stroustrup, "It feels

python的系统模块builtins快速查看

python是简单的一门语言,是因为里面存在了很多的模块使用,就好如linux中的也有理解命令的使用"man"."help",而python也有. 用下面的命令查看>>> dir(__builtins__) >>> dir(__builtins__) ['ArithmeticError', 'AssertionError', 'AttributeError', 'BaseException', 'BlockingIOError',

python附录-builtins.py模块str类源码(含str官方文档链接)

python附录-builtins.py模块str类源码 str官方文档链接:https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str builtins.py class str(object): """ str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str Create a new stri

修改python原文件中的from、to字段

1down votefavorite 1 Here's an excerpt from the code I'm using. I'm looping through the part that adds the email; my problem is rather than changing the "to" field on each loop, it is appending the "to" data. Obviously this causes some

python学习笔记(二)

一.版本问题 python2与python3是目前主要的两个版本. python3.0版本较之前的有很大变动,而且不向下兼容. Python 2.7作为一个过渡版本,基本使用了Python 2.x的语法和库,同时考虑了向Python 3.0的迁移.即2.7版本兼容2.x和3.0的语法 Python 2.7保持了对之前版本的全兼容,而且还包含了Python 3.0的新玩意(一些新特性需要通过"from __future__ import"来启用). 如果想要在python2.7中使用:p

python基础之函数

python 函数 函数是组织好的,可重复使用的,用来实现单一,或相关联功能的代码段. 函数能提高应用的模块性,和代码的重复利用率.你已经知道Python提供了许多内建函数,比如print().但你也可以自己创建函数,这被叫做用户自定义函数. 定义一个函数 在Python中,定义一个函数要使用def语句,依次写出函数名.括号.括号中的参数和冒号:,然后,在缩进块中编写函数体,函数的返回值用return语句返回. 函数式编程和面向过程编程的区别: 函数式:将某功能代码封装到函数中,日后便无需重复编

python list练习题

1.合并两个有序列表,并且保持合并后的列表有序 In [20]: lst1 = [32, 42, 12, 5, 14, 4, 1] In [21]: lst2 = [199, 22, 324, 89, 2] In [22]: help(lst1.sort) Help on built-in function sort: sort(...) method of builtins.list instance     L.sort(key=None, reverse=False) -> None --

Python模块动态加载机制

本文和大家分享的主要是python中模块动态加载机制相关内容,一起来看看吧,希望对大家学习python有所帮助. import 指令 来看看 import sys 所产生的指令: co_consts : (0, None) co_names : ('sys',) 0 LOAD_CONST               0 (0) 2 LOAD_CONST               1 (None) 4 IMPORT_NAME              0 (sys) 6 STORE_NAME  

Python 3 笔记

############################################################################################ 内      容: Python 3 # 作     者: 娜爱# 更新日期: 2017.07.18  # 在cmd中执行py文件(路径可加双引号),如:python E:\PythonSrc\mypy_package\eg.py##########################################