•        Python : 3.7.3
  •          OS : Ubuntu 18.04.2 LTS
  •         IDE : pycharm-community-2019.1.3
  •       Conda : 4.7.5
  •    typesetting : Markdown

code

coder@ubuntu:~$ source activate py37
(py37) coder@ubuntu:~$ ipython
Python 3.7.3 (default, Mar 27 2019, 22:11:17)
Type 'copyright', 'credits' or 'license' for more information
IPython 7.5.0 -- An enhanced Interactive Python. Type '?' for help. In [1]: help(long)
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-1-5610b93dd7ae> in <module>
----> 1 help(long) NameError: name 'long' is not defined In [2]: type(2 ** 100)
Out[2]: int In [3]: exit
(py37) coder@ubuntu:~$ conda deactivate
coder@ubuntu:~$

source_code

class int(object):
"""
int([x]) -> integer
int(x, base=10) -> integer Convert a number or string to an integer, or return 0 if no arguments
are given. If x is a number, return x.__int__(). For floating point
numbers, this truncates towards zero. If x is not a number or if base is given, then x must be a string,
bytes, or bytearray instance representing an integer literal in the
given base. The literal can be preceded by '+' or '-' and be surrounded
by whitespace. The base defaults to 10. Valid bases are 0 and 2-36.
Base 0 means to interpret the base from the string as an integer literal.
>>> int('0b100', base=0)
4
"""
def bit_length(self): # real signature unknown; restored from __doc__
"""
Number of bits necessary to represent self in binary. >>> bin(37)
'0b100101'
>>> (37).bit_length()
6
"""
pass def conjugate(self, *args, **kwargs): # real signature unknown
""" Returns self, the complex conjugate of any int. """
pass @classmethod # known case
def from_bytes(cls, *args, **kwargs): # real signature unknown
"""
Return the integer represented by the given array of bytes. bytes
Holds the array of bytes to convert. The argument must either
support the buffer protocol or be an iterable object producing bytes.
Bytes and bytearray are examples of built-in objects that support the
buffer protocol.
byteorder
The byte order used to represent the integer. If byteorder is 'big',
the most significant byte is at the beginning of the byte array. If
byteorder is 'little', the most significant byte is at the end of the
byte array. To request the native byte order of the host system, use
`sys.byteorder' as the byte order value.
signed
Indicates whether two's complement is used to represent the integer.
"""
pass def to_bytes(self, *args, **kwargs): # real signature unknown
"""
Return an array of bytes representing an integer. length
Length of bytes object to use. An OverflowError is raised if the
integer is not representable with the given number of bytes.
byteorder
The byte order used to represent the integer. If byteorder is 'big',
the most significant byte is at the beginning of the byte array. If
byteorder is 'little', the most significant byte is at the end of the
byte array. To request the native byte order of the host system, use
`sys.byteorder' as the byte order value.
signed
Determines whether two's complement is used to represent the integer.
If signed is False and a negative integer is given, an OverflowError
is raised.
"""
pass def __abs__(self, *args, **kwargs): # real signature unknown
""" abs(self) """
pass def __add__(self, *args, **kwargs): # real signature unknown
""" Return self+value. """
pass def __and__(self, *args, **kwargs): # real signature unknown
""" Return self&value. """
pass def __bool__(self, *args, **kwargs): # real signature unknown
""" self != 0 """
pass def __ceil__(self, *args, **kwargs): # real signature unknown
""" Ceiling of an Integral returns itself. """
pass def __divmod__(self, *args, **kwargs): # real signature unknown
""" Return divmod(self, value). """
pass def __eq__(self, *args, **kwargs): # real signature unknown
""" Return self==value. """
pass def __float__(self, *args, **kwargs): # real signature unknown
""" float(self) """
pass def __floordiv__(self, *args, **kwargs): # real signature unknown
""" Return self//value. """
pass def __floor__(self, *args, **kwargs): # real signature unknown
""" Flooring an Integral returns itself. """
pass def __format__(self, *args, **kwargs): # real signature unknown
pass def __getattribute__(self, *args, **kwargs): # real signature unknown
""" Return getattr(self, name). """
pass def __getnewargs__(self, *args, **kwargs): # real signature unknown
pass def __ge__(self, *args, **kwargs): # real signature unknown
""" Return self>=value. """
pass def __gt__(self, *args, **kwargs): # real signature unknown
""" Return self>value. """
pass def __hash__(self, *args, **kwargs): # real signature unknown
""" Return hash(self). """
pass def __index__(self, *args, **kwargs): # real signature unknown
""" Return self converted to an integer, if self is suitable for use as an index into a list. """
pass def __init__(self, x, base=10): # known special case of int.__init__
"""
int([x]) -> integer
int(x, base=10) -> integer Convert a number or string to an integer, or return 0 if no arguments
are given. If x is a number, return x.__int__(). For floating point
numbers, this truncates towards zero. If x is not a number or if base is given, then x must be a string,
bytes, or bytearray instance representing an integer literal in the
given base. The literal can be preceded by '+' or '-' and be surrounded
by whitespace. The base defaults to 10. Valid bases are 0 and 2-36.
Base 0 means to interpret the base from the string as an integer literal.
>>> int('0b100', base=0)
4
# (copied from class doc)
"""
pass def __int__(self, *args, **kwargs): # real signature unknown
""" int(self) """
pass def __invert__(self, *args, **kwargs): # real signature unknown
""" ~self """
pass def __le__(self, *args, **kwargs): # real signature unknown
""" Return self<=value. """
pass def __lshift__(self, *args, **kwargs): # real signature unknown
""" Return self<<value. """
pass def __lt__(self, *args, **kwargs): # real signature unknown
""" Return self<value. """
pass def __mod__(self, *args, **kwargs): # real signature unknown
""" Return self%value. """
pass def __mul__(self, *args, **kwargs): # real signature unknown
""" Return self*value. """
pass def __neg__(self, *args, **kwargs): # real signature unknown
""" -self """
pass @staticmethod # known case of __new__
def __new__(*args, **kwargs): # real signature unknown
""" Create and return a new object. See help(type) for accurate signature. """
pass def __ne__(self, *args, **kwargs): # real signature unknown
""" Return self!=value. """
pass def __or__(self, *args, **kwargs): # real signature unknown
""" Return self|value. """
pass def __pos__(self, *args, **kwargs): # real signature unknown
""" +self """
pass def __pow__(self, *args, **kwargs): # real signature unknown
""" Return pow(self, value, mod). """
pass def __radd__(self, *args, **kwargs): # real signature unknown
""" Return value+self. """
pass def __rand__(self, *args, **kwargs): # real signature unknown
""" Return value&self. """
pass def __rdivmod__(self, *args, **kwargs): # real signature unknown
""" Return divmod(value, self). """
pass def __repr__(self, *args, **kwargs): # real signature unknown
""" Return repr(self). """
pass def __rfloordiv__(self, *args, **kwargs): # real signature unknown
""" Return value//self. """
pass def __rlshift__(self, *args, **kwargs): # real signature unknown
""" Return value<<self. """
pass def __rmod__(self, *args, **kwargs): # real signature unknown
""" Return value%self. """
pass def __rmul__(self, *args, **kwargs): # real signature unknown
""" Return value*self. """
pass def __ror__(self, *args, **kwargs): # real signature unknown
""" Return value|self. """
pass def __round__(self, *args, **kwargs): # real signature unknown
"""
Rounding an Integral returns itself.
Rounding with an ndigits argument also returns an integer.
"""
pass def __rpow__(self, *args, **kwargs): # real signature unknown
""" Return pow(value, self, mod). """
pass def __rrshift__(self, *args, **kwargs): # real signature unknown
""" Return value>>self. """
pass def __rshift__(self, *args, **kwargs): # real signature unknown
""" Return self>>value. """
pass def __rsub__(self, *args, **kwargs): # real signature unknown
""" Return value-self. """
pass def __rtruediv__(self, *args, **kwargs): # real signature unknown
""" Return value/self. """
pass def __rxor__(self, *args, **kwargs): # real signature unknown
""" Return value^self. """
pass def __sizeof__(self, *args, **kwargs): # real signature unknown
""" Returns size in memory, in bytes. """
pass def __str__(self, *args, **kwargs): # real signature unknown
""" Return str(self). """
pass def __sub__(self, *args, **kwargs): # real signature unknown
""" Return self-value. """
pass def __truediv__(self, *args, **kwargs): # real signature unknown
""" Return self/value. """
pass def __trunc__(self, *args, **kwargs): # real signature unknown
""" Truncating an Integral returns itself. """
pass def __xor__(self, *args, **kwargs): # real signature unknown
""" Return self^value. """
pass denominator = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""the denominator of a rational number in lowest terms""" imag = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""the imaginary part of a complex number""" numerator = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""the numerator of a rational number in lowest terms""" real = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""the real part of a complex number"""

resource

  • [文档 - English] docs.python.org/3
  • [文档 - 中文] docs.python.org/zh-cn/3
  • [规范] www.python.org/dev/peps/pep-0008
  • [规范] zh-google-styleguide.readthedocs.io/en/latest/google-python-styleguide/python_language_rules
  • [源码] www.python.org/downloads/source
  • [ PEP ] www.python.org/dev/peps
  • [平台] www.cnblogs.com
  • [平台] gitee.com


Python具有开源、跨平台、解释型、交互式等特性,值得学习。

Python的设计哲学:优雅,明确,简单。提倡用一种方法,最好是只有一种方法来做一件事。

代码的书写要遵守规范,这样有助于沟通和理解。

每种语言都有独特的思想,初学者需要转变思维、踏实践行、坚持积累。

Python3基础 只有int类型,没有long类型的更多相关文章

  1. Python3基础 函数 参数为list可变类型时,使用append会影响到外部实参

             Python : 3.7.3          OS : Ubuntu 18.04.2 LTS         IDE : pycharm-community-2019.1.3    ...

  2. 零基础如何学好Python 之int 数字整型类型 定义int()范围大小转换

    本文主题是讲python数字类型python int整型使用方法及技巧.它是不可变数据类型中的一种,它的一些性质和字符串是一样的,注意是整型不是整形哦. Python int有多种数字类型:整型int ...

  3. C#基础知识系列二(值类型和引用类型、可空类型、堆和栈、装箱和拆箱)

    前言 之前对几个没什么理解,只是简单的用过可空类型,也是知道怎么用,至于为什么,还真不太清楚,通过整理本文章学到了很多知识,也许对于以后的各种代码优化都有好处. 本文的重点就是:值类型直接存储其值,引 ...

  4. 自定义TypeConverter把基础类型转换为复杂类型

    原文(http://tech.it168.com/d/2008-06-30/200806300953554_all.shtml) TypeConverter对于编写ASP.NET Server Con ...

  5. c#基础系列1---深入理解值类型和引用类型

    "大菜":源于自己刚踏入猿途混沌拾起,自我感觉不是一般的菜,因而得名"大菜",于自身共勉. 不知不觉已经踏入坑已10余年之多,对于c#多多少少有一点自己的认识, ...

  6. { MySQL基础数据类型}一 介绍 二 数值类型 三 日期类型 四 字符串类型 五 枚举类型与集合类型

    MySQL基础数据类型 阅读目录 一 介绍 二 数值类型 三 日期类型 四 字符串类型 五 枚举类型与集合类型 一 介绍 存储引擎决定了表的类型,而表内存放的数据也要有不同的类型,每种数据类型都有自己 ...

  7. C#学习笔记(基础知识回顾)之值类型与引用类型转换(装箱和拆箱)

    一:值类型和引用类型的含义参考前一篇文章 C#学习笔记(基础知识回顾)之值类型和引用类型 1.1,C#数据类型分为在栈上分配内存的值类型和在托管堆上分配内存的引用类型.如果int只不过是栈上的一个4字 ...

  8. C#学习笔记(基础知识回顾)之值类型和引用类型

    一:C#把数据类型分为值类型和引用类型 1.1:从概念上来看,其区别是值类型直接存储值,而引用类型存储对值的引用. 1.2:这两种类型在内存的不同地方,值类型存储在堆栈中,而引用类型存储在托管对上.存 ...

  9. Python3:数字类型和字符串类型的相互转换

    Python3:数字类型和字符串类型的相互转换 一.python中字符串转换成数字 方法1: 类中进行导入:import string str='555'num=string.atoi(str)num ...

随机推荐

  1. 《你们都是魔鬼吗》第八次团队作业:第四天Alpha冲刺

    <你们都是魔鬼吗>第八次团队作业:Alpha冲刺 项目 内容 这个作业属于哪个课程 任课教师博客主页链接 这个作业的要求在哪里 作业链接地址 团队名称 你们都是魔鬼吗 作业学习目标 完成最 ...

  2. 结构型模式(一) 适配器模式(Adapter)

    一.动机(Motivation) 在软件系统中,由于应用环境的变化,常常需要将"一些现存的对象"放在新的环境中应用,但是新环境要求的接口是这些现存对象所不满足的. 如何应对这种&q ...

  3. 接口中的JSON报文

    原始报文: 请求报文: [ { "appNo" : "", "applicantCredentialCode" : "" ...

  4. 织梦cms 后台查看会员性别为空

    织梦cms会员注册选择性别为保密时,在后台会员中心查看性别为空的修改方法 第一步:找到dede/templets/member_view.htm,在引号中添加保密就ok 再次修改后的结果

  5. Emmet的HTML语法(敲代码的快捷方式)

    Emmet的HTML语法(敲代码的快捷方式)   版权声明:本文为网上转载.   所有操作按下“tab”键即可瞬间完成 元素 1.在编辑器中输入元素名称,即可自动补全生成 HTML 标签,即使不是标准 ...

  6. (转载) SQL Server AG集群启动不起来的临时自救大招

    背景 前晚一朋友遇到AG集群发生来回切换不稳定的情况,情急之下,朋友在命令行使用命令重启WSFC集群 结果重启WSFC集群之后,非但没有好转,导致整个AG无法启动,主副本和辅助副本都处于正在解析的状态 ...

  7. 012——软件安装之_matlab2019安装

    (一)参考文献:https://www.isharepc.com/14196.html (二)下载地址: 链接:https://pan.baidu.com/s/1gq06TuBWGr1Qc4owpRX ...

  8. Python + Apache Kylin 让数据分析更加简单!

    现如今,大数据.数据科学和机器学习不仅是技术圈的热门话题,也是当今社会的重要组成.数据就在每个人身边,同时每天正以惊人的速度快速增长,据福布斯报道:到 2025 年,每年将产生大约 175 个 Zet ...

  9. zeebe 集成elasticsearch exporter && 添加operate

    zeebe 的operate是一个功能比较强大的管理工具,比simple-monitor 有好多方面上的改进 安全,支持用户账户的登陆 界面更友好,界面比较符合开团队工作流引擎的界面 系统监控更加强大 ...

  10. C语言 选择排序算法原理和实现 从数组中 找出最小的元素然后交换位置

    #include <stdio.h> int main(void) { /* 选择排序算法 原理:从数组中 找出最小的元素然后交换位置: */ int a[10] = {9,5,10,7, ...