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
516c51c1
Kaydet (Commit)
516c51c1
authored
Tem 29, 2011
tarafından
Éric Araujo
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Merge from 3.2 (#9254, #8982, #9788)
üst
c473f8ce
fe1e298d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
18 deletions
+16
-18
argparse.rst
Doc/library/argparse.rst
+10
-7
atexit.rst
Doc/library/atexit.rst
+3
-1
functions.rst
Doc/library/functions.rst
+3
-10
No files found.
Doc/library/argparse.rst
Dosyayı görüntüle @
516c51c1
...
...
@@ -110,7 +110,7 @@ Parsing arguments
:class:`ArgumentParser` parses args through the
:meth:`~ArgumentParser.parse_args` method. This will inspect the command line,
convert each arg to the appropriate type and then invoke the appropriate action.
In most cases, this means a simple
namespace
object will be built up from
In most cases, this means a simple
:class:`Namespace`
object will be built up from
attributes parsed out of the command line::
>>> parser.parse_args(['--sum', '7', '-1', '42'])
...
...
@@ -741,7 +741,7 @@ the Action API. The easiest way to do this is to extend
* ``parser`` - The ArgumentParser object which contains this action.
* ``namespace`` - The
namespace
object that will be returned by
* ``namespace`` - The
:class:`Namespace`
object that will be returned by
:meth:`~ArgumentParser.parse_args`. Most actions add an attribute to this
object.
...
...
@@ -1352,11 +1352,14 @@ interactive prompt::
The Namespace object
^^^^^^^^^^^^^^^^^^^^
By default, :meth:`~ArgumentParser.parse_args` will return a new object of type
:class:`Namespace` where the necessary attributes have been set. This class is
deliberately simple, just an :class:`object` subclass with a readable string
representation. If you prefer to have dict-like view of the attributes, you
can use the standard Python idiom via :func:`vars`::
.. class:: Namespace
Simple class used by default by :meth:`~ArgumentParser.parse_args` to create
an object holding attributes and return it.
This class is deliberately simple, just an :class:`object` subclass with a
readable string representation. If you prefer to have dict-like view of the
attributes, you can use the standard Python idiom, :func:`vars`::
>>> parser = argparse.ArgumentParser()
>>> parser.add_argument('--foo')
...
...
Doc/library/atexit.rst
Dosyayı görüntüle @
516c51c1
...
...
@@ -9,7 +9,9 @@
The :mod:`atexit` module defines functions to register and unregister cleanup
functions. Functions thus registered are automatically executed upon normal
interpreter termination.
interpreter termination. The order in which the functions are called is not
defined; if you have cleanup operations that depend on each other, you should
wrap them in a function and register that one. This keeps :mod:`atexit` simple.
Note: the functions registered via this module are not called when the program
is killed by a signal not handled by Python, when a Python fatal internal error
...
...
Doc/library/functions.rst
Dosyayı görüntüle @
516c51c1
...
...
@@ -1387,7 +1387,7 @@ are always available. They are listed here in alphabetical order.
.. note::
This is an advanced function that is not needed in everyday Python
programming.
programming
, unlike :func:`importlib.import_module`
.
This function is invoked by the :keyword:`import` statement. It can be
replaced (by importing the :mod:`builtins` module and assigning to
...
...
@@ -1437,15 +1437,8 @@ are always available. They are listed here in alphabetical order.
names.
If you simply want to import a module (potentially within a package) by name,
you can call :func:`__import__` and then look it up in :data:`sys.modules`::
>>> import sys
>>> name = 'foo.bar.baz'
>>> __import__(name)
<module 'foo' from ...>
>>> baz = sys.modules[name]
>>> baz
<module 'foo.bar.baz' from ...>
use :func:`importlib.import_module`.
.. rubric:: Footnotes
...
...
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