Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
6f82cd30
Kaydet (Commit)
6f82cd30
authored
Şub 06, 2010
tarafından
Georg Brandl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
#5341: fix "builtin" where used as an adjective ("built-in" is correct).
üst
2d798ac6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
30 additions
and
27 deletions
+30
-27
design.rst
Doc/faq/design.rst
+4
-3
extending.rst
Doc/faq/extending.rst
+1
-1
library.rst
Doc/faq/library.rst
+13
-12
programming.rst
Doc/faq/programming.rst
+7
-6
doanddont.rst
Doc/howto/doanddont.rst
+4
-4
inspect.rst
Doc/library/inspect.rst
+1
-1
No files found.
Doc/faq/design.rst
Dosyayı görüntüle @
6f82cd30
...
...
@@ -664,9 +664,10 @@ order to remind you of that fact, it does not return the sorted list. This way,
you won't be fooled into accidentally overwriting a list when you need a sorted
copy but also need to keep the unsorted version around.
In Python 2.4 a new builtin -- :func:`sorted` -- has been added. This function
creates a new list from a provided iterable, sorts it and returns it. For
example, here's how to iterate over the keys of a dictionary in sorted order::
In Python 2.4 a new built-in function -- :func:`sorted` -- has been added.
This function creates a new list from a provided iterable, sorts it and returns
it. For example, here's how to iterate over the keys of a dictionary in sorted
order::
for key in sorted(mydict):
... # do whatever with mydict[key]...
...
...
Doc/faq/extending.rst
Dosyayı görüntüle @
6f82cd30
...
...
@@ -439,7 +439,7 @@ extension module using g++ (e.g., ``g++ -shared -o mymodule.so mymodule.o``).
Can I create an object class with some methods implemented in C and others in Python (e.g. through inheritance)?
----------------------------------------------------------------------------------------------------------------
In Python 2.2, you can inherit from builtin classes such as :class:`int`,
In Python 2.2, you can inherit from built
-
in classes such as :class:`int`,
:class:`list`, :class:`dict`, etc.
The Boost Python Library (BPL, http://www.boost.org/libs/python/doc/index.html)
...
...
Doc/faq/library.rst
Dosyayı görüntüle @
6f82cd30
...
...
@@ -25,10 +25,10 @@ your topic of interest will usually find something helpful.
Where is the math.py (socket.py, regex.py, etc.) source file?
-------------------------------------------------------------
If you can't find a source file for a module it may be a built
in or dynamically
loaded module implemented in C, C++ or other compiled language. In this case
you may not have the source file or it may be something like mathmodule.c,
somewhere in a C source directory (not on the Python Path).
If you can't find a source file for a module it may be a built
-in or
dynamically loaded module implemented in C, C++ or other compiled language.
In this case you may not have the source file or it may be something like
mathmodule.c,
somewhere in a C source directory (not on the Python Path).
There are (at least) three kinds of modules in Python:
...
...
@@ -359,7 +359,7 @@ therefore atomic from the point of view of a Python program.
In theory, this means an exact accounting requires an exact understanding of the
PVM bytecode implementation. In practice, it means that operations on shared
variables of builtin data types (ints, lists, dicts, etc) that "look atomic"
variables of built
-
in data types (ints, lists, dicts, etc) that "look atomic"
really are.
For example, the following operations are all atomic (L, L1, L2 are lists, D,
...
...
@@ -502,9 +502,9 @@ I can't seem to use os.read() on a pipe created with os.popen(); why?
:func:`os.read` is a low-level function which takes a file descriptor, a small
integer representing the opened file. :func:`os.popen` creates a high-level
file object, the same type returned by the built
in :func:`open` function. Thus,
to read n bytes from a pipe p created with :func:`os.popen`, you need to use
``p.read(n)``.
file object, the same type returned by the built
-in :func:`open` function.
Thus, to read n bytes from a pipe p created with :func:`os.popen`, you need to
use
``p.read(n)``.
How do I run a subprocess with pipes connected to both input and output?
...
...
@@ -603,10 +603,11 @@ Python file objects are a high-level layer of abstraction on top of C streams,
which in turn are a medium-level layer of abstraction on top of (among other
things) low-level C file descriptors.
For most file objects you create in Python via the builtin ``file`` constructor,
``f.close()`` marks the Python file object as being closed from Python's point
of view, and also arranges to close the underlying C stream. This also happens
automatically in f's destructor, when f becomes garbage.
For most file objects you create in Python via the built-in ``file``
constructor, ``f.close()`` marks the Python file object as being closed from
Python's point of view, and also arranges to close the underlying C stream.
This also happens automatically in ``f``'s destructor, when ``f`` becomes
garbage.
But stdin, stdout and stderr are treated specially by Python, because of the
special status also given to them by C. Running ``sys.stdout.close()`` marks
...
...
Doc/faq/programming.rst
Dosyayı görüntüle @
6f82cd30
...
...
@@ -178,9 +178,10 @@ it is much shorter and far faster to use ::
L2 = list(L1[:3]) # "list" is redundant if L1 is a list.
Note that the functionally-oriented builtins such as :func:`map`, :func:`zip`,
and friends can be a convenient accelerator for loops that perform a single
task. For example to pair the elements of two lists together::
Note that the functionally-oriented built-in functions such as :func:`map`,
:func:`zip`, and friends can be a convenient accelerator for loops that
perform a single task. For example to pair the elements of two lists
together::
>>> zip([1, 2, 3], [4, 5, 6])
[(1, 4), (2, 5), (3, 6)]
...
...
@@ -203,7 +204,7 @@ on string objects <string-methods>`. Use regular expressions only when you're
not dealing with constant string patterns. You may still use :ref:`the old %
operations <string-formatting>` ``string % tuple`` and ``string % dictionary``.
Be sure to use the :meth:`list.sort` builtin method to do sorting, and see the
Be sure to use the :meth:`list.sort` built
-
in method to do sorting, and see the
`sorting mini-HOWTO <http://wiki.python.org/moin/HowTo/Sorting>`_ for examples
of moderately advanced usage. :meth:`list.sort` beats other techniques for
sorting in all but the most extreme circumstances.
...
...
@@ -346,7 +347,7 @@ Though a bit surprising at first, a moment's consideration explains this. On
one hand, requiring :keyword:`global` for assigned variables provides a bar
against unintended side-effects. On the other hand, if ``global`` was required
for all global references, you'd be using ``global`` all the time. You'd have
to declare as global every reference to a builtin function or to a component of
to declare as global every reference to a built
-
in function or to a component of
an imported module. This clutter would defeat the usefulness of the ``global``
declaration for identifying side-effects.
...
...
@@ -1059,7 +1060,7 @@ trailing newline from a string.
How do I iterate over a sequence in reverse order?
--------------------------------------------------
Use the :func:`reversed` builtin function, which is new in Python 2.4::
Use the :func:`reversed` built
-
in function, which is new in Python 2.4::
for x in reversed(sequence):
... # do something with x...
...
...
Doc/howto/doanddont.rst
Dosyayı görüntüle @
6f82cd30
...
...
@@ -52,10 +52,10 @@ One of the most awful question asked on the newsgroup is why this code::
f.read()
does not work. Of course, it works just fine (assuming you have a file called
"www".) But it does not work if somewhere in the module, the statement ``from
os
import *`` is present. The :mod:`os` module has a function called :func:`open`
which returns an integer. While it is very useful, shadowing builtins is one of
its least useful properties.
"www".) But it does not work if somewhere in the module, the statement ``from
os import *`` is present. The :mod:`os` module has a function called
:func:`open` which returns an integer. While it is very useful, shadowing a
builtin is one of
its least useful properties.
Remember, you can never know for sure what names a module exports, so either
take what you need --- ``from module import name1, name2``, or keep them in the
...
...
Doc/library/inspect.rst
Dosyayı görüntüle @
6f82cd30
...
...
@@ -126,7 +126,7 @@ attributes:
| frame | f_back | next outer frame object | |
| | | (this frame's caller) | |
+-----------+-----------------+---------------------------+-------+
| | f_builtins | built
-in
namespace seen | |
| | f_builtins | built
ins
namespace seen | |
| | | by this frame | |
+-----------+-----------------+---------------------------+-------+
| | f_code | code object being | |
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment