summaryrefslogtreecommitdiffstats
path: root/FOSS/Python/Dependencies/future-0.18.2/docs/int_object.rst
diff options
context:
space:
mode:
authoryum <yum.food.vr@gmail.com>2023-01-23 14:28:53 -0800
committeryum <yum.food.vr@gmail.com>2023-01-23 14:32:09 -0800
commit9fff496394dcd94c4084694ca96a5e07ab836274 (patch)
treed89b78e16ecb6011bdd74555da79f7a8c1d90752 /FOSS/Python/Dependencies/future-0.18.2/docs/int_object.rst
parent9329d64f991b8b3289af22e4c2eedb09a97c5640 (diff)
package.ps1 now fetches all dependencies
Don't literally check in Python since it looks dodgy (rightfully so). Instead the build script just fetches it. * Update README, simplifying language and documenting other projects
Diffstat (limited to 'FOSS/Python/Dependencies/future-0.18.2/docs/int_object.rst')
-rw-r--r--FOSS/Python/Dependencies/future-0.18.2/docs/int_object.rst68
1 files changed, 0 insertions, 68 deletions
diff --git a/FOSS/Python/Dependencies/future-0.18.2/docs/int_object.rst b/FOSS/Python/Dependencies/future-0.18.2/docs/int_object.rst
deleted file mode 100644
index f774784..0000000
--- a/FOSS/Python/Dependencies/future-0.18.2/docs/int_object.rst
+++ /dev/null
@@ -1,68 +0,0 @@
-.. _int-object:
-
-int
----
-
-Python 3's ``int`` type is very similar to Python 2's ``long``, except
-for the representation (which omits the ``L`` suffix in Python 2). Python
-2's usual (short) integers have been removed from Python 3, as has the
-``long`` builtin name.
-
-Python 3::
-
- >>> 2**64
- 18446744073709551616
-
-Python 2::
-
- >>> 2**64
- 18446744073709551616L
-
-``future`` includes a backport of Python 3's ``int`` that
-is a subclass of Python 2's ``long`` with the same representation
-behaviour as Python 3's ``int``. To ensure an integer is long compatibly with
-both Py3 and Py2, cast it like this::
-
- >>> from builtins import int
- >>> must_be_a_long_integer = int(1234)
-
-The backported ``int`` object helps with writing doctests and simplifies code
-that deals with ``long`` and ``int`` as special cases on Py2. An example is the
-following code from ``xlwt-future`` (called by the ``xlwt.antlr.BitSet`` class)
-for writing out Excel ``.xls`` spreadsheets. With ``future``, the code is::
-
- from builtins import int
-
- def longify(data):
- """
- Turns data (an int or long, or a list of ints or longs) into a
- list of longs.
- """
- if not data:
- return [int(0)]
- if not isinstance(data, list):
- return [int(data)]
- return list(map(int, data))
-
-
-Without ``future`` (or with ``future`` < 0.7), this might be::
-
- def longify(data):
- """
- Turns data (an int or long, or a list of ints or longs) into a
- list of longs.
- """
- if not data:
- if PY3:
- return [0]
- else:
- return [long(0)]
- if not isinstance(data,list):
- if PY3:
- return [int(data)]
- else:
- return [long(data)]
- if PY3:
- return list(map(int, data)) # same as returning data, but with up-front typechecking
- else:
- return list(map(long, data))