Python built-in functions (BIF) and pythonbif

Source: Internet
Author: User

Python built-in functions (BIF) and pythonbif
As the name suggests, BIF (built-in functions) is an Erlang built-in function. They are usually used to complete tasks that cannot be completed using Erlang. For example, convert the list to a tuples or obtain the current
. The function that completes these operations is called BIF. Python provides a large number of built-in functions, which means you can have less code.
You can enter dir (_ builtins _) in python or IDLE shell to view the python built-in method list. There are two underscores before and after "builtins", and the shell will give
The huge list is as follows:
['Arithmeticerror', 'assertionerror', 'bubuteerror', 'baseexception', 'blockingioerror', 'brokenpipeerror', 'buffererror', 'byteswarning ',
'Childprocessererror', 'ononabortederror ', 'ononerror', 'ononrefusederror', 'connectionreseterror ',
'Descationwarning', 'eoferror', 'ellipsis ', 'environmenterror', 'exception', 'false', 'fileexistserror ', 'filenotfounderror ',
'Floatingpointerror ', 'ureurewarning', 'generatorexit', 'ioerror', 'importererror', 'importwarning', 'indentationerror', 'indexerror ',
'Interruptedererror', 'isadirectoryerror', 'keyerror', 'keyboardinterrupt', 'lookupererror', 'memoryerror', 'nameerror', 'none ',
'Notadirectoryerror', 'notimplemented', 'notimplementederror ', 'osserror', 'overflowerror', 'pendingdeprecationwarning ',
'Permissionerror', 'processlookuperror ', 'referenceerror', 'resourcewarning', 'runtimeerror', 'runtimewarning', 'stopiteration ',
'Syntaxerror', 'syntaxwarning', 'systemerror', 'systemdelete', 'taberror', 'timeoutererror', '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 ',
'Compute', 'copyright', 'credits ', 'delattr', 'dict', 'dir', 'didmod ', 'enumerate', 'eval', 'exec ', 'Exit ', 'filter', 'float', 'format', 'frozenset ',
'Getattr', 'globals', 'hasattr', 'hash', 'help', 'hex', 'id', 'input', 'isinstance ', 'issubclass ', 'iter', 'len', 'license ', 'LIST', 'locals', 'map ',
'Max', 'memoryview', 'Min', 'Next', 'object', 'oct', 'open', 'ord ', 'pow', 'print ', 'properties', 'quit', 'range', 'repr', 'reversed ', 'round', 'set ',
'Setattr', 'slice ', 'sorted', 'staticmethod', 'str', 'sum', 'super', 'tuple', 'type', 'vars ', 'zip']
To view what a BIF is doing, type help (method name) in the shell, for example, help (isinstance), and you will get the function description of this BIF:
>>> Help (isinstance)
Help on built-in function isinstance in module builtins:
Isinstance (...)
Isinstance (object, class-or-type-or-tuple)-> bool
Return whether an object is an instance of a class or of a subclass thereof.
With a type as second argument, return whether that is the object's type.
The form using a tuple, isinstance (x, (A, B,...), is a temporary cut

Isinstance (x, A) or isinstance (x, B) or... (etc .).

You can get the introduction and usage of the isinstance function.


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.